
obj/user/faultio.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 42 00 00 00       	call   800073 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:
#include <inc/lib.h>
#include <inc/x86.h>

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	83 ec 08             	sub    $0x8,%esp

static inline uint32_t
read_eflags(void)
{
	uint32_t eflags;
	asm volatile("pushfl; popl %0" : "=r" (eflags));
  80003d:	9c                   	pushf  
  80003e:	58                   	pop    %eax
        int x, r;
	int nsecs = 1;
	int secno = 0;
	int diskno = 1;

	if (read_eflags() & FL_IOPL_3)
  80003f:	f6 c4 30             	test   $0x30,%ah
  800042:	75 1d                	jne    800061 <umain+0x2e>
	asm volatile("outb %0,%w1" : : "a" (data), "d" (port));
  800044:	b8 f0 ff ff ff       	mov    $0xfffffff0,%eax
  800049:	ba f6 01 00 00       	mov    $0x1f6,%edx
  80004e:	ee                   	out    %al,(%dx)

	// this outb to select disk 1 should result in a general protection
	// fault, because user-level code shouldn't be able to use the io space.
	outb(0x1F6, 0xE0 | (1<<4));

        cprintf("%s: made it here --- bug\n");
  80004f:	83 ec 0c             	sub    $0xc,%esp
  800052:	68 0e 1f 80 00       	push   $0x801f0e
  800057:	e8 26 01 00 00       	call   800182 <cprintf>
}
  80005c:	83 c4 10             	add    $0x10,%esp
  80005f:	c9                   	leave  
  800060:	c3                   	ret    
		cprintf("eflags wrong\n");
  800061:	83 ec 0c             	sub    $0xc,%esp
  800064:	68 00 1f 80 00       	push   $0x801f00
  800069:	e8 14 01 00 00       	call   800182 <cprintf>
  80006e:	83 c4 10             	add    $0x10,%esp
  800071:	eb d1                	jmp    800044 <umain+0x11>

00800073 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  800073:	f3 0f 1e fb          	endbr32 
  800077:	55                   	push   %ebp
  800078:	89 e5                	mov    %esp,%ebp
  80007a:	56                   	push   %esi
  80007b:	53                   	push   %ebx
  80007c:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80007f:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  800082:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  800089:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  80008c:	e8 c6 0a 00 00       	call   800b57 <sys_getenvid>
  800091:	25 ff 03 00 00       	and    $0x3ff,%eax
  800096:	6b c0 7c             	imul   $0x7c,%eax,%eax
  800099:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  80009e:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  8000a3:	85 db                	test   %ebx,%ebx
  8000a5:	7e 07                	jle    8000ae <libmain+0x3b>
		binaryname = argv[0];
  8000a7:	8b 06                	mov    (%esi),%eax
  8000a9:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  8000ae:	83 ec 08             	sub    $0x8,%esp
  8000b1:	56                   	push   %esi
  8000b2:	53                   	push   %ebx
  8000b3:	e8 7b ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  8000b8:	e8 0a 00 00 00       	call   8000c7 <exit>
}
  8000bd:	83 c4 10             	add    $0x10,%esp
  8000c0:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8000c3:	5b                   	pop    %ebx
  8000c4:	5e                   	pop    %esi
  8000c5:	5d                   	pop    %ebp
  8000c6:	c3                   	ret    

008000c7 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  8000c7:	f3 0f 1e fb          	endbr32 
  8000cb:	55                   	push   %ebp
  8000cc:	89 e5                	mov    %esp,%ebp
  8000ce:	83 ec 08             	sub    $0x8,%esp
	close_all();
  8000d1:	e8 c7 0e 00 00       	call   800f9d <close_all>
	sys_env_destroy(0);
  8000d6:	83 ec 0c             	sub    $0xc,%esp
  8000d9:	6a 00                	push   $0x0
  8000db:	e8 32 0a 00 00       	call   800b12 <sys_env_destroy>
}
  8000e0:	83 c4 10             	add    $0x10,%esp
  8000e3:	c9                   	leave  
  8000e4:	c3                   	ret    

008000e5 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  8000e5:	f3 0f 1e fb          	endbr32 
  8000e9:	55                   	push   %ebp
  8000ea:	89 e5                	mov    %esp,%ebp
  8000ec:	53                   	push   %ebx
  8000ed:	83 ec 04             	sub    $0x4,%esp
  8000f0:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  8000f3:	8b 13                	mov    (%ebx),%edx
  8000f5:	8d 42 01             	lea    0x1(%edx),%eax
  8000f8:	89 03                	mov    %eax,(%ebx)
  8000fa:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8000fd:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  800101:	3d ff 00 00 00       	cmp    $0xff,%eax
  800106:	74 09                	je     800111 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  800108:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  80010c:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80010f:	c9                   	leave  
  800110:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  800111:	83 ec 08             	sub    $0x8,%esp
  800114:	68 ff 00 00 00       	push   $0xff
  800119:	8d 43 08             	lea    0x8(%ebx),%eax
  80011c:	50                   	push   %eax
  80011d:	e8 ab 09 00 00       	call   800acd <sys_cputs>
		b->idx = 0;
  800122:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  800128:	83 c4 10             	add    $0x10,%esp
  80012b:	eb db                	jmp    800108 <putch+0x23>

0080012d <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  80012d:	f3 0f 1e fb          	endbr32 
  800131:	55                   	push   %ebp
  800132:	89 e5                	mov    %esp,%ebp
  800134:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  80013a:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  800141:	00 00 00 
	b.cnt = 0;
  800144:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  80014b:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  80014e:	ff 75 0c             	pushl  0xc(%ebp)
  800151:	ff 75 08             	pushl  0x8(%ebp)
  800154:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  80015a:	50                   	push   %eax
  80015b:	68 e5 00 80 00       	push   $0x8000e5
  800160:	e8 20 01 00 00       	call   800285 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800165:	83 c4 08             	add    $0x8,%esp
  800168:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  80016e:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  800174:	50                   	push   %eax
  800175:	e8 53 09 00 00       	call   800acd <sys_cputs>

	return b.cnt;
}
  80017a:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  800180:	c9                   	leave  
  800181:	c3                   	ret    

00800182 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800182:	f3 0f 1e fb          	endbr32 
  800186:	55                   	push   %ebp
  800187:	89 e5                	mov    %esp,%ebp
  800189:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  80018c:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  80018f:	50                   	push   %eax
  800190:	ff 75 08             	pushl  0x8(%ebp)
  800193:	e8 95 ff ff ff       	call   80012d <vcprintf>
	va_end(ap);

	return cnt;
}
  800198:	c9                   	leave  
  800199:	c3                   	ret    

0080019a <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  80019a:	55                   	push   %ebp
  80019b:	89 e5                	mov    %esp,%ebp
  80019d:	57                   	push   %edi
  80019e:	56                   	push   %esi
  80019f:	53                   	push   %ebx
  8001a0:	83 ec 1c             	sub    $0x1c,%esp
  8001a3:	89 c7                	mov    %eax,%edi
  8001a5:	89 d6                	mov    %edx,%esi
  8001a7:	8b 45 08             	mov    0x8(%ebp),%eax
  8001aa:	8b 55 0c             	mov    0xc(%ebp),%edx
  8001ad:	89 d1                	mov    %edx,%ecx
  8001af:	89 c2                	mov    %eax,%edx
  8001b1:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8001b4:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8001b7:	8b 45 10             	mov    0x10(%ebp),%eax
  8001ba:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  8001bd:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8001c0:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8001c7:	39 c2                	cmp    %eax,%edx
  8001c9:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  8001cc:	72 3e                	jb     80020c <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  8001ce:	83 ec 0c             	sub    $0xc,%esp
  8001d1:	ff 75 18             	pushl  0x18(%ebp)
  8001d4:	83 eb 01             	sub    $0x1,%ebx
  8001d7:	53                   	push   %ebx
  8001d8:	50                   	push   %eax
  8001d9:	83 ec 08             	sub    $0x8,%esp
  8001dc:	ff 75 e4             	pushl  -0x1c(%ebp)
  8001df:	ff 75 e0             	pushl  -0x20(%ebp)
  8001e2:	ff 75 dc             	pushl  -0x24(%ebp)
  8001e5:	ff 75 d8             	pushl  -0x28(%ebp)
  8001e8:	e8 b3 1a 00 00       	call   801ca0 <__udivdi3>
  8001ed:	83 c4 18             	add    $0x18,%esp
  8001f0:	52                   	push   %edx
  8001f1:	50                   	push   %eax
  8001f2:	89 f2                	mov    %esi,%edx
  8001f4:	89 f8                	mov    %edi,%eax
  8001f6:	e8 9f ff ff ff       	call   80019a <printnum>
  8001fb:	83 c4 20             	add    $0x20,%esp
  8001fe:	eb 13                	jmp    800213 <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  800200:	83 ec 08             	sub    $0x8,%esp
  800203:	56                   	push   %esi
  800204:	ff 75 18             	pushl  0x18(%ebp)
  800207:	ff d7                	call   *%edi
  800209:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  80020c:	83 eb 01             	sub    $0x1,%ebx
  80020f:	85 db                	test   %ebx,%ebx
  800211:	7f ed                	jg     800200 <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  800213:	83 ec 08             	sub    $0x8,%esp
  800216:	56                   	push   %esi
  800217:	83 ec 04             	sub    $0x4,%esp
  80021a:	ff 75 e4             	pushl  -0x1c(%ebp)
  80021d:	ff 75 e0             	pushl  -0x20(%ebp)
  800220:	ff 75 dc             	pushl  -0x24(%ebp)
  800223:	ff 75 d8             	pushl  -0x28(%ebp)
  800226:	e8 85 1b 00 00       	call   801db0 <__umoddi3>
  80022b:	83 c4 14             	add    $0x14,%esp
  80022e:	0f be 80 32 1f 80 00 	movsbl 0x801f32(%eax),%eax
  800235:	50                   	push   %eax
  800236:	ff d7                	call   *%edi
}
  800238:	83 c4 10             	add    $0x10,%esp
  80023b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80023e:	5b                   	pop    %ebx
  80023f:	5e                   	pop    %esi
  800240:	5f                   	pop    %edi
  800241:	5d                   	pop    %ebp
  800242:	c3                   	ret    

00800243 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  800243:	f3 0f 1e fb          	endbr32 
  800247:	55                   	push   %ebp
  800248:	89 e5                	mov    %esp,%ebp
  80024a:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  80024d:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800251:	8b 10                	mov    (%eax),%edx
  800253:	3b 50 04             	cmp    0x4(%eax),%edx
  800256:	73 0a                	jae    800262 <sprintputch+0x1f>
		*b->buf++ = ch;
  800258:	8d 4a 01             	lea    0x1(%edx),%ecx
  80025b:	89 08                	mov    %ecx,(%eax)
  80025d:	8b 45 08             	mov    0x8(%ebp),%eax
  800260:	88 02                	mov    %al,(%edx)
}
  800262:	5d                   	pop    %ebp
  800263:	c3                   	ret    

00800264 <printfmt>:
{
  800264:	f3 0f 1e fb          	endbr32 
  800268:	55                   	push   %ebp
  800269:	89 e5                	mov    %esp,%ebp
  80026b:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  80026e:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  800271:	50                   	push   %eax
  800272:	ff 75 10             	pushl  0x10(%ebp)
  800275:	ff 75 0c             	pushl  0xc(%ebp)
  800278:	ff 75 08             	pushl  0x8(%ebp)
  80027b:	e8 05 00 00 00       	call   800285 <vprintfmt>
}
  800280:	83 c4 10             	add    $0x10,%esp
  800283:	c9                   	leave  
  800284:	c3                   	ret    

00800285 <vprintfmt>:
{
  800285:	f3 0f 1e fb          	endbr32 
  800289:	55                   	push   %ebp
  80028a:	89 e5                	mov    %esp,%ebp
  80028c:	57                   	push   %edi
  80028d:	56                   	push   %esi
  80028e:	53                   	push   %ebx
  80028f:	83 ec 3c             	sub    $0x3c,%esp
  800292:	8b 75 08             	mov    0x8(%ebp),%esi
  800295:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  800298:	8b 7d 10             	mov    0x10(%ebp),%edi
  80029b:	e9 5d 03 00 00       	jmp    8005fd <vprintfmt+0x378>
		padc = ' ';
  8002a0:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  8002a4:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  8002ab:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  8002b2:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  8002b9:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8002be:	8d 47 01             	lea    0x1(%edi),%eax
  8002c1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8002c4:	0f b6 17             	movzbl (%edi),%edx
  8002c7:	8d 42 dd             	lea    -0x23(%edx),%eax
  8002ca:	3c 55                	cmp    $0x55,%al
  8002cc:	0f 87 ae 03 00 00    	ja     800680 <vprintfmt+0x3fb>
  8002d2:	0f b6 c0             	movzbl %al,%eax
  8002d5:	3e ff 24 85 80 20 80 	notrack jmp *0x802080(,%eax,4)
  8002dc:	00 
  8002dd:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  8002e0:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  8002e4:	eb d8                	jmp    8002be <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8002e6:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  8002e9:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  8002ed:	eb cf                	jmp    8002be <vprintfmt+0x39>
  8002ef:	0f b6 d2             	movzbl %dl,%edx
  8002f2:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  8002f5:	b8 00 00 00 00       	mov    $0x0,%eax
  8002fa:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  8002fd:	8d 04 80             	lea    (%eax,%eax,4),%eax
  800300:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  800304:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  800307:	8d 4a d0             	lea    -0x30(%edx),%ecx
  80030a:	83 f9 09             	cmp    $0x9,%ecx
  80030d:	77 55                	ja     800364 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  80030f:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  800312:	eb e9                	jmp    8002fd <vprintfmt+0x78>
			precision = va_arg(ap, int);
  800314:	8b 45 14             	mov    0x14(%ebp),%eax
  800317:	8b 00                	mov    (%eax),%eax
  800319:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80031c:	8b 45 14             	mov    0x14(%ebp),%eax
  80031f:	8d 40 04             	lea    0x4(%eax),%eax
  800322:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800325:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  800328:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  80032c:	79 90                	jns    8002be <vprintfmt+0x39>
				width = precision, precision = -1;
  80032e:	8b 45 d8             	mov    -0x28(%ebp),%eax
  800331:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800334:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  80033b:	eb 81                	jmp    8002be <vprintfmt+0x39>
  80033d:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  800340:	85 c0                	test   %eax,%eax
  800342:	ba 00 00 00 00       	mov    $0x0,%edx
  800347:	0f 49 d0             	cmovns %eax,%edx
  80034a:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  80034d:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800350:	e9 69 ff ff ff       	jmp    8002be <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800355:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800358:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  80035f:	e9 5a ff ff ff       	jmp    8002be <vprintfmt+0x39>
  800364:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800367:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80036a:	eb bc                	jmp    800328 <vprintfmt+0xa3>
			lflag++;
  80036c:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80036f:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800372:	e9 47 ff ff ff       	jmp    8002be <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  800377:	8b 45 14             	mov    0x14(%ebp),%eax
  80037a:	8d 78 04             	lea    0x4(%eax),%edi
  80037d:	83 ec 08             	sub    $0x8,%esp
  800380:	53                   	push   %ebx
  800381:	ff 30                	pushl  (%eax)
  800383:	ff d6                	call   *%esi
			break;
  800385:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  800388:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  80038b:	e9 6a 02 00 00       	jmp    8005fa <vprintfmt+0x375>
			err = va_arg(ap, int);
  800390:	8b 45 14             	mov    0x14(%ebp),%eax
  800393:	8d 78 04             	lea    0x4(%eax),%edi
  800396:	8b 00                	mov    (%eax),%eax
  800398:	99                   	cltd   
  800399:	31 d0                	xor    %edx,%eax
  80039b:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  80039d:	83 f8 0f             	cmp    $0xf,%eax
  8003a0:	7f 23                	jg     8003c5 <vprintfmt+0x140>
  8003a2:	8b 14 85 e0 21 80 00 	mov    0x8021e0(,%eax,4),%edx
  8003a9:	85 d2                	test   %edx,%edx
  8003ab:	74 18                	je     8003c5 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  8003ad:	52                   	push   %edx
  8003ae:	68 11 23 80 00       	push   $0x802311
  8003b3:	53                   	push   %ebx
  8003b4:	56                   	push   %esi
  8003b5:	e8 aa fe ff ff       	call   800264 <printfmt>
  8003ba:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003bd:	89 7d 14             	mov    %edi,0x14(%ebp)
  8003c0:	e9 35 02 00 00       	jmp    8005fa <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  8003c5:	50                   	push   %eax
  8003c6:	68 4a 1f 80 00       	push   $0x801f4a
  8003cb:	53                   	push   %ebx
  8003cc:	56                   	push   %esi
  8003cd:	e8 92 fe ff ff       	call   800264 <printfmt>
  8003d2:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003d5:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  8003d8:	e9 1d 02 00 00       	jmp    8005fa <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  8003dd:	8b 45 14             	mov    0x14(%ebp),%eax
  8003e0:	83 c0 04             	add    $0x4,%eax
  8003e3:	89 45 c8             	mov    %eax,-0x38(%ebp)
  8003e6:	8b 45 14             	mov    0x14(%ebp),%eax
  8003e9:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  8003eb:	85 d2                	test   %edx,%edx
  8003ed:	b8 43 1f 80 00       	mov    $0x801f43,%eax
  8003f2:	0f 45 c2             	cmovne %edx,%eax
  8003f5:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  8003f8:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8003fc:	7e 06                	jle    800404 <vprintfmt+0x17f>
  8003fe:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  800402:	75 0d                	jne    800411 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  800404:	8b 45 cc             	mov    -0x34(%ebp),%eax
  800407:	89 c7                	mov    %eax,%edi
  800409:	03 45 d4             	add    -0x2c(%ebp),%eax
  80040c:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  80040f:	eb 55                	jmp    800466 <vprintfmt+0x1e1>
  800411:	83 ec 08             	sub    $0x8,%esp
  800414:	ff 75 d8             	pushl  -0x28(%ebp)
  800417:	ff 75 cc             	pushl  -0x34(%ebp)
  80041a:	e8 15 03 00 00       	call   800734 <strnlen>
  80041f:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  800422:	29 c2                	sub    %eax,%edx
  800424:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  800427:	83 c4 10             	add    $0x10,%esp
  80042a:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  80042c:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  800430:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  800433:	85 ff                	test   %edi,%edi
  800435:	7e 11                	jle    800448 <vprintfmt+0x1c3>
					putch(padc, putdat);
  800437:	83 ec 08             	sub    $0x8,%esp
  80043a:	53                   	push   %ebx
  80043b:	ff 75 d4             	pushl  -0x2c(%ebp)
  80043e:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  800440:	83 ef 01             	sub    $0x1,%edi
  800443:	83 c4 10             	add    $0x10,%esp
  800446:	eb eb                	jmp    800433 <vprintfmt+0x1ae>
  800448:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  80044b:	85 d2                	test   %edx,%edx
  80044d:	b8 00 00 00 00       	mov    $0x0,%eax
  800452:	0f 49 c2             	cmovns %edx,%eax
  800455:	29 c2                	sub    %eax,%edx
  800457:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  80045a:	eb a8                	jmp    800404 <vprintfmt+0x17f>
					putch(ch, putdat);
  80045c:	83 ec 08             	sub    $0x8,%esp
  80045f:	53                   	push   %ebx
  800460:	52                   	push   %edx
  800461:	ff d6                	call   *%esi
  800463:	83 c4 10             	add    $0x10,%esp
  800466:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800469:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  80046b:	83 c7 01             	add    $0x1,%edi
  80046e:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800472:	0f be d0             	movsbl %al,%edx
  800475:	85 d2                	test   %edx,%edx
  800477:	74 4b                	je     8004c4 <vprintfmt+0x23f>
  800479:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  80047d:	78 06                	js     800485 <vprintfmt+0x200>
  80047f:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  800483:	78 1e                	js     8004a3 <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  800485:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  800489:	74 d1                	je     80045c <vprintfmt+0x1d7>
  80048b:	0f be c0             	movsbl %al,%eax
  80048e:	83 e8 20             	sub    $0x20,%eax
  800491:	83 f8 5e             	cmp    $0x5e,%eax
  800494:	76 c6                	jbe    80045c <vprintfmt+0x1d7>
					putch('?', putdat);
  800496:	83 ec 08             	sub    $0x8,%esp
  800499:	53                   	push   %ebx
  80049a:	6a 3f                	push   $0x3f
  80049c:	ff d6                	call   *%esi
  80049e:	83 c4 10             	add    $0x10,%esp
  8004a1:	eb c3                	jmp    800466 <vprintfmt+0x1e1>
  8004a3:	89 cf                	mov    %ecx,%edi
  8004a5:	eb 0e                	jmp    8004b5 <vprintfmt+0x230>
				putch(' ', putdat);
  8004a7:	83 ec 08             	sub    $0x8,%esp
  8004aa:	53                   	push   %ebx
  8004ab:	6a 20                	push   $0x20
  8004ad:	ff d6                	call   *%esi
			for (; width > 0; width--)
  8004af:	83 ef 01             	sub    $0x1,%edi
  8004b2:	83 c4 10             	add    $0x10,%esp
  8004b5:	85 ff                	test   %edi,%edi
  8004b7:	7f ee                	jg     8004a7 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  8004b9:	8b 45 c8             	mov    -0x38(%ebp),%eax
  8004bc:	89 45 14             	mov    %eax,0x14(%ebp)
  8004bf:	e9 36 01 00 00       	jmp    8005fa <vprintfmt+0x375>
  8004c4:	89 cf                	mov    %ecx,%edi
  8004c6:	eb ed                	jmp    8004b5 <vprintfmt+0x230>
	if (lflag >= 2)
  8004c8:	83 f9 01             	cmp    $0x1,%ecx
  8004cb:	7f 1f                	jg     8004ec <vprintfmt+0x267>
	else if (lflag)
  8004cd:	85 c9                	test   %ecx,%ecx
  8004cf:	74 67                	je     800538 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  8004d1:	8b 45 14             	mov    0x14(%ebp),%eax
  8004d4:	8b 00                	mov    (%eax),%eax
  8004d6:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8004d9:	89 c1                	mov    %eax,%ecx
  8004db:	c1 f9 1f             	sar    $0x1f,%ecx
  8004de:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8004e1:	8b 45 14             	mov    0x14(%ebp),%eax
  8004e4:	8d 40 04             	lea    0x4(%eax),%eax
  8004e7:	89 45 14             	mov    %eax,0x14(%ebp)
  8004ea:	eb 17                	jmp    800503 <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  8004ec:	8b 45 14             	mov    0x14(%ebp),%eax
  8004ef:	8b 50 04             	mov    0x4(%eax),%edx
  8004f2:	8b 00                	mov    (%eax),%eax
  8004f4:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8004f7:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8004fa:	8b 45 14             	mov    0x14(%ebp),%eax
  8004fd:	8d 40 08             	lea    0x8(%eax),%eax
  800500:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  800503:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800506:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  800509:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  80050e:	85 c9                	test   %ecx,%ecx
  800510:	0f 89 ca 00 00 00    	jns    8005e0 <vprintfmt+0x35b>
				putch('-', putdat);
  800516:	83 ec 08             	sub    $0x8,%esp
  800519:	53                   	push   %ebx
  80051a:	6a 2d                	push   $0x2d
  80051c:	ff d6                	call   *%esi
				num = -(long long) num;
  80051e:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800521:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  800524:	f7 da                	neg    %edx
  800526:	83 d1 00             	adc    $0x0,%ecx
  800529:	f7 d9                	neg    %ecx
  80052b:	83 c4 10             	add    $0x10,%esp
			base = 10;
  80052e:	b8 0a 00 00 00       	mov    $0xa,%eax
  800533:	e9 a8 00 00 00       	jmp    8005e0 <vprintfmt+0x35b>
		return va_arg(*ap, int);
  800538:	8b 45 14             	mov    0x14(%ebp),%eax
  80053b:	8b 00                	mov    (%eax),%eax
  80053d:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800540:	99                   	cltd   
  800541:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800544:	8b 45 14             	mov    0x14(%ebp),%eax
  800547:	8d 40 04             	lea    0x4(%eax),%eax
  80054a:	89 45 14             	mov    %eax,0x14(%ebp)
  80054d:	eb b4                	jmp    800503 <vprintfmt+0x27e>
	if (lflag >= 2)
  80054f:	83 f9 01             	cmp    $0x1,%ecx
  800552:	7f 1b                	jg     80056f <vprintfmt+0x2ea>
	else if (lflag)
  800554:	85 c9                	test   %ecx,%ecx
  800556:	74 2c                	je     800584 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800558:	8b 45 14             	mov    0x14(%ebp),%eax
  80055b:	8b 10                	mov    (%eax),%edx
  80055d:	b9 00 00 00 00       	mov    $0x0,%ecx
  800562:	8d 40 04             	lea    0x4(%eax),%eax
  800565:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800568:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  80056d:	eb 71                	jmp    8005e0 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  80056f:	8b 45 14             	mov    0x14(%ebp),%eax
  800572:	8b 10                	mov    (%eax),%edx
  800574:	8b 48 04             	mov    0x4(%eax),%ecx
  800577:	8d 40 08             	lea    0x8(%eax),%eax
  80057a:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80057d:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  800582:	eb 5c                	jmp    8005e0 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800584:	8b 45 14             	mov    0x14(%ebp),%eax
  800587:	8b 10                	mov    (%eax),%edx
  800589:	b9 00 00 00 00       	mov    $0x0,%ecx
  80058e:	8d 40 04             	lea    0x4(%eax),%eax
  800591:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800594:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  800599:	eb 45                	jmp    8005e0 <vprintfmt+0x35b>
			putch('X', putdat);
  80059b:	83 ec 08             	sub    $0x8,%esp
  80059e:	53                   	push   %ebx
  80059f:	6a 58                	push   $0x58
  8005a1:	ff d6                	call   *%esi
			putch('X', putdat);
  8005a3:	83 c4 08             	add    $0x8,%esp
  8005a6:	53                   	push   %ebx
  8005a7:	6a 58                	push   $0x58
  8005a9:	ff d6                	call   *%esi
			putch('X', putdat);
  8005ab:	83 c4 08             	add    $0x8,%esp
  8005ae:	53                   	push   %ebx
  8005af:	6a 58                	push   $0x58
  8005b1:	ff d6                	call   *%esi
			break;
  8005b3:	83 c4 10             	add    $0x10,%esp
  8005b6:	eb 42                	jmp    8005fa <vprintfmt+0x375>
			putch('0', putdat);
  8005b8:	83 ec 08             	sub    $0x8,%esp
  8005bb:	53                   	push   %ebx
  8005bc:	6a 30                	push   $0x30
  8005be:	ff d6                	call   *%esi
			putch('x', putdat);
  8005c0:	83 c4 08             	add    $0x8,%esp
  8005c3:	53                   	push   %ebx
  8005c4:	6a 78                	push   $0x78
  8005c6:	ff d6                	call   *%esi
			num = (unsigned long long)
  8005c8:	8b 45 14             	mov    0x14(%ebp),%eax
  8005cb:	8b 10                	mov    (%eax),%edx
  8005cd:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  8005d2:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  8005d5:	8d 40 04             	lea    0x4(%eax),%eax
  8005d8:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8005db:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  8005e0:	83 ec 0c             	sub    $0xc,%esp
  8005e3:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  8005e7:	57                   	push   %edi
  8005e8:	ff 75 d4             	pushl  -0x2c(%ebp)
  8005eb:	50                   	push   %eax
  8005ec:	51                   	push   %ecx
  8005ed:	52                   	push   %edx
  8005ee:	89 da                	mov    %ebx,%edx
  8005f0:	89 f0                	mov    %esi,%eax
  8005f2:	e8 a3 fb ff ff       	call   80019a <printnum>
			break;
  8005f7:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  8005fa:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  8005fd:	83 c7 01             	add    $0x1,%edi
  800600:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800604:	83 f8 25             	cmp    $0x25,%eax
  800607:	0f 84 93 fc ff ff    	je     8002a0 <vprintfmt+0x1b>
			if (ch == '\0')
  80060d:	85 c0                	test   %eax,%eax
  80060f:	0f 84 8b 00 00 00    	je     8006a0 <vprintfmt+0x41b>
			putch(ch, putdat);
  800615:	83 ec 08             	sub    $0x8,%esp
  800618:	53                   	push   %ebx
  800619:	50                   	push   %eax
  80061a:	ff d6                	call   *%esi
  80061c:	83 c4 10             	add    $0x10,%esp
  80061f:	eb dc                	jmp    8005fd <vprintfmt+0x378>
	if (lflag >= 2)
  800621:	83 f9 01             	cmp    $0x1,%ecx
  800624:	7f 1b                	jg     800641 <vprintfmt+0x3bc>
	else if (lflag)
  800626:	85 c9                	test   %ecx,%ecx
  800628:	74 2c                	je     800656 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  80062a:	8b 45 14             	mov    0x14(%ebp),%eax
  80062d:	8b 10                	mov    (%eax),%edx
  80062f:	b9 00 00 00 00       	mov    $0x0,%ecx
  800634:	8d 40 04             	lea    0x4(%eax),%eax
  800637:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80063a:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  80063f:	eb 9f                	jmp    8005e0 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800641:	8b 45 14             	mov    0x14(%ebp),%eax
  800644:	8b 10                	mov    (%eax),%edx
  800646:	8b 48 04             	mov    0x4(%eax),%ecx
  800649:	8d 40 08             	lea    0x8(%eax),%eax
  80064c:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80064f:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  800654:	eb 8a                	jmp    8005e0 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800656:	8b 45 14             	mov    0x14(%ebp),%eax
  800659:	8b 10                	mov    (%eax),%edx
  80065b:	b9 00 00 00 00       	mov    $0x0,%ecx
  800660:	8d 40 04             	lea    0x4(%eax),%eax
  800663:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800666:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  80066b:	e9 70 ff ff ff       	jmp    8005e0 <vprintfmt+0x35b>
			putch(ch, putdat);
  800670:	83 ec 08             	sub    $0x8,%esp
  800673:	53                   	push   %ebx
  800674:	6a 25                	push   $0x25
  800676:	ff d6                	call   *%esi
			break;
  800678:	83 c4 10             	add    $0x10,%esp
  80067b:	e9 7a ff ff ff       	jmp    8005fa <vprintfmt+0x375>
			putch('%', putdat);
  800680:	83 ec 08             	sub    $0x8,%esp
  800683:	53                   	push   %ebx
  800684:	6a 25                	push   $0x25
  800686:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800688:	83 c4 10             	add    $0x10,%esp
  80068b:	89 f8                	mov    %edi,%eax
  80068d:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  800691:	74 05                	je     800698 <vprintfmt+0x413>
  800693:	83 e8 01             	sub    $0x1,%eax
  800696:	eb f5                	jmp    80068d <vprintfmt+0x408>
  800698:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80069b:	e9 5a ff ff ff       	jmp    8005fa <vprintfmt+0x375>
}
  8006a0:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8006a3:	5b                   	pop    %ebx
  8006a4:	5e                   	pop    %esi
  8006a5:	5f                   	pop    %edi
  8006a6:	5d                   	pop    %ebp
  8006a7:	c3                   	ret    

008006a8 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  8006a8:	f3 0f 1e fb          	endbr32 
  8006ac:	55                   	push   %ebp
  8006ad:	89 e5                	mov    %esp,%ebp
  8006af:	83 ec 18             	sub    $0x18,%esp
  8006b2:	8b 45 08             	mov    0x8(%ebp),%eax
  8006b5:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  8006b8:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8006bb:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  8006bf:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  8006c2:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  8006c9:	85 c0                	test   %eax,%eax
  8006cb:	74 26                	je     8006f3 <vsnprintf+0x4b>
  8006cd:	85 d2                	test   %edx,%edx
  8006cf:	7e 22                	jle    8006f3 <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  8006d1:	ff 75 14             	pushl  0x14(%ebp)
  8006d4:	ff 75 10             	pushl  0x10(%ebp)
  8006d7:	8d 45 ec             	lea    -0x14(%ebp),%eax
  8006da:	50                   	push   %eax
  8006db:	68 43 02 80 00       	push   $0x800243
  8006e0:	e8 a0 fb ff ff       	call   800285 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  8006e5:	8b 45 ec             	mov    -0x14(%ebp),%eax
  8006e8:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  8006eb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8006ee:	83 c4 10             	add    $0x10,%esp
}
  8006f1:	c9                   	leave  
  8006f2:	c3                   	ret    
		return -E_INVAL;
  8006f3:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8006f8:	eb f7                	jmp    8006f1 <vsnprintf+0x49>

008006fa <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  8006fa:	f3 0f 1e fb          	endbr32 
  8006fe:	55                   	push   %ebp
  8006ff:	89 e5                	mov    %esp,%ebp
  800701:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  800704:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  800707:	50                   	push   %eax
  800708:	ff 75 10             	pushl  0x10(%ebp)
  80070b:	ff 75 0c             	pushl  0xc(%ebp)
  80070e:	ff 75 08             	pushl  0x8(%ebp)
  800711:	e8 92 ff ff ff       	call   8006a8 <vsnprintf>
	va_end(ap);

	return rc;
}
  800716:	c9                   	leave  
  800717:	c3                   	ret    

00800718 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  800718:	f3 0f 1e fb          	endbr32 
  80071c:	55                   	push   %ebp
  80071d:	89 e5                	mov    %esp,%ebp
  80071f:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  800722:	b8 00 00 00 00       	mov    $0x0,%eax
  800727:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  80072b:	74 05                	je     800732 <strlen+0x1a>
		n++;
  80072d:	83 c0 01             	add    $0x1,%eax
  800730:	eb f5                	jmp    800727 <strlen+0xf>
	return n;
}
  800732:	5d                   	pop    %ebp
  800733:	c3                   	ret    

00800734 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800734:	f3 0f 1e fb          	endbr32 
  800738:	55                   	push   %ebp
  800739:	89 e5                	mov    %esp,%ebp
  80073b:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80073e:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  800741:	b8 00 00 00 00       	mov    $0x0,%eax
  800746:	39 d0                	cmp    %edx,%eax
  800748:	74 0d                	je     800757 <strnlen+0x23>
  80074a:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  80074e:	74 05                	je     800755 <strnlen+0x21>
		n++;
  800750:	83 c0 01             	add    $0x1,%eax
  800753:	eb f1                	jmp    800746 <strnlen+0x12>
  800755:	89 c2                	mov    %eax,%edx
	return n;
}
  800757:	89 d0                	mov    %edx,%eax
  800759:	5d                   	pop    %ebp
  80075a:	c3                   	ret    

0080075b <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  80075b:	f3 0f 1e fb          	endbr32 
  80075f:	55                   	push   %ebp
  800760:	89 e5                	mov    %esp,%ebp
  800762:	53                   	push   %ebx
  800763:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800766:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800769:	b8 00 00 00 00       	mov    $0x0,%eax
  80076e:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  800772:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  800775:	83 c0 01             	add    $0x1,%eax
  800778:	84 d2                	test   %dl,%dl
  80077a:	75 f2                	jne    80076e <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  80077c:	89 c8                	mov    %ecx,%eax
  80077e:	5b                   	pop    %ebx
  80077f:	5d                   	pop    %ebp
  800780:	c3                   	ret    

00800781 <strcat>:

char *
strcat(char *dst, const char *src)
{
  800781:	f3 0f 1e fb          	endbr32 
  800785:	55                   	push   %ebp
  800786:	89 e5                	mov    %esp,%ebp
  800788:	53                   	push   %ebx
  800789:	83 ec 10             	sub    $0x10,%esp
  80078c:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  80078f:	53                   	push   %ebx
  800790:	e8 83 ff ff ff       	call   800718 <strlen>
  800795:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  800798:	ff 75 0c             	pushl  0xc(%ebp)
  80079b:	01 d8                	add    %ebx,%eax
  80079d:	50                   	push   %eax
  80079e:	e8 b8 ff ff ff       	call   80075b <strcpy>
	return dst;
}
  8007a3:	89 d8                	mov    %ebx,%eax
  8007a5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8007a8:	c9                   	leave  
  8007a9:	c3                   	ret    

008007aa <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  8007aa:	f3 0f 1e fb          	endbr32 
  8007ae:	55                   	push   %ebp
  8007af:	89 e5                	mov    %esp,%ebp
  8007b1:	56                   	push   %esi
  8007b2:	53                   	push   %ebx
  8007b3:	8b 75 08             	mov    0x8(%ebp),%esi
  8007b6:	8b 55 0c             	mov    0xc(%ebp),%edx
  8007b9:	89 f3                	mov    %esi,%ebx
  8007bb:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  8007be:	89 f0                	mov    %esi,%eax
  8007c0:	39 d8                	cmp    %ebx,%eax
  8007c2:	74 11                	je     8007d5 <strncpy+0x2b>
		*dst++ = *src;
  8007c4:	83 c0 01             	add    $0x1,%eax
  8007c7:	0f b6 0a             	movzbl (%edx),%ecx
  8007ca:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  8007cd:	80 f9 01             	cmp    $0x1,%cl
  8007d0:	83 da ff             	sbb    $0xffffffff,%edx
  8007d3:	eb eb                	jmp    8007c0 <strncpy+0x16>
	}
	return ret;
}
  8007d5:	89 f0                	mov    %esi,%eax
  8007d7:	5b                   	pop    %ebx
  8007d8:	5e                   	pop    %esi
  8007d9:	5d                   	pop    %ebp
  8007da:	c3                   	ret    

008007db <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  8007db:	f3 0f 1e fb          	endbr32 
  8007df:	55                   	push   %ebp
  8007e0:	89 e5                	mov    %esp,%ebp
  8007e2:	56                   	push   %esi
  8007e3:	53                   	push   %ebx
  8007e4:	8b 75 08             	mov    0x8(%ebp),%esi
  8007e7:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8007ea:	8b 55 10             	mov    0x10(%ebp),%edx
  8007ed:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  8007ef:	85 d2                	test   %edx,%edx
  8007f1:	74 21                	je     800814 <strlcpy+0x39>
  8007f3:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  8007f7:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  8007f9:	39 c2                	cmp    %eax,%edx
  8007fb:	74 14                	je     800811 <strlcpy+0x36>
  8007fd:	0f b6 19             	movzbl (%ecx),%ebx
  800800:	84 db                	test   %bl,%bl
  800802:	74 0b                	je     80080f <strlcpy+0x34>
			*dst++ = *src++;
  800804:	83 c1 01             	add    $0x1,%ecx
  800807:	83 c2 01             	add    $0x1,%edx
  80080a:	88 5a ff             	mov    %bl,-0x1(%edx)
  80080d:	eb ea                	jmp    8007f9 <strlcpy+0x1e>
  80080f:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  800811:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800814:	29 f0                	sub    %esi,%eax
}
  800816:	5b                   	pop    %ebx
  800817:	5e                   	pop    %esi
  800818:	5d                   	pop    %ebp
  800819:	c3                   	ret    

0080081a <strcmp>:

int
strcmp(const char *p, const char *q)
{
  80081a:	f3 0f 1e fb          	endbr32 
  80081e:	55                   	push   %ebp
  80081f:	89 e5                	mov    %esp,%ebp
  800821:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800824:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800827:	0f b6 01             	movzbl (%ecx),%eax
  80082a:	84 c0                	test   %al,%al
  80082c:	74 0c                	je     80083a <strcmp+0x20>
  80082e:	3a 02                	cmp    (%edx),%al
  800830:	75 08                	jne    80083a <strcmp+0x20>
		p++, q++;
  800832:	83 c1 01             	add    $0x1,%ecx
  800835:	83 c2 01             	add    $0x1,%edx
  800838:	eb ed                	jmp    800827 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  80083a:	0f b6 c0             	movzbl %al,%eax
  80083d:	0f b6 12             	movzbl (%edx),%edx
  800840:	29 d0                	sub    %edx,%eax
}
  800842:	5d                   	pop    %ebp
  800843:	c3                   	ret    

00800844 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800844:	f3 0f 1e fb          	endbr32 
  800848:	55                   	push   %ebp
  800849:	89 e5                	mov    %esp,%ebp
  80084b:	53                   	push   %ebx
  80084c:	8b 45 08             	mov    0x8(%ebp),%eax
  80084f:	8b 55 0c             	mov    0xc(%ebp),%edx
  800852:	89 c3                	mov    %eax,%ebx
  800854:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800857:	eb 06                	jmp    80085f <strncmp+0x1b>
		n--, p++, q++;
  800859:	83 c0 01             	add    $0x1,%eax
  80085c:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  80085f:	39 d8                	cmp    %ebx,%eax
  800861:	74 16                	je     800879 <strncmp+0x35>
  800863:	0f b6 08             	movzbl (%eax),%ecx
  800866:	84 c9                	test   %cl,%cl
  800868:	74 04                	je     80086e <strncmp+0x2a>
  80086a:	3a 0a                	cmp    (%edx),%cl
  80086c:	74 eb                	je     800859 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  80086e:	0f b6 00             	movzbl (%eax),%eax
  800871:	0f b6 12             	movzbl (%edx),%edx
  800874:	29 d0                	sub    %edx,%eax
}
  800876:	5b                   	pop    %ebx
  800877:	5d                   	pop    %ebp
  800878:	c3                   	ret    
		return 0;
  800879:	b8 00 00 00 00       	mov    $0x0,%eax
  80087e:	eb f6                	jmp    800876 <strncmp+0x32>

00800880 <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  800880:	f3 0f 1e fb          	endbr32 
  800884:	55                   	push   %ebp
  800885:	89 e5                	mov    %esp,%ebp
  800887:	8b 45 08             	mov    0x8(%ebp),%eax
  80088a:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80088e:	0f b6 10             	movzbl (%eax),%edx
  800891:	84 d2                	test   %dl,%dl
  800893:	74 09                	je     80089e <strchr+0x1e>
		if (*s == c)
  800895:	38 ca                	cmp    %cl,%dl
  800897:	74 0a                	je     8008a3 <strchr+0x23>
	for (; *s; s++)
  800899:	83 c0 01             	add    $0x1,%eax
  80089c:	eb f0                	jmp    80088e <strchr+0xe>
			return (char *) s;
	return 0;
  80089e:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8008a3:	5d                   	pop    %ebp
  8008a4:	c3                   	ret    

008008a5 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  8008a5:	f3 0f 1e fb          	endbr32 
  8008a9:	55                   	push   %ebp
  8008aa:	89 e5                	mov    %esp,%ebp
  8008ac:	8b 45 08             	mov    0x8(%ebp),%eax
  8008af:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8008b3:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  8008b6:	38 ca                	cmp    %cl,%dl
  8008b8:	74 09                	je     8008c3 <strfind+0x1e>
  8008ba:	84 d2                	test   %dl,%dl
  8008bc:	74 05                	je     8008c3 <strfind+0x1e>
	for (; *s; s++)
  8008be:	83 c0 01             	add    $0x1,%eax
  8008c1:	eb f0                	jmp    8008b3 <strfind+0xe>
			break;
	return (char *) s;
}
  8008c3:	5d                   	pop    %ebp
  8008c4:	c3                   	ret    

008008c5 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  8008c5:	f3 0f 1e fb          	endbr32 
  8008c9:	55                   	push   %ebp
  8008ca:	89 e5                	mov    %esp,%ebp
  8008cc:	57                   	push   %edi
  8008cd:	56                   	push   %esi
  8008ce:	53                   	push   %ebx
  8008cf:	8b 7d 08             	mov    0x8(%ebp),%edi
  8008d2:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  8008d5:	85 c9                	test   %ecx,%ecx
  8008d7:	74 31                	je     80090a <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  8008d9:	89 f8                	mov    %edi,%eax
  8008db:	09 c8                	or     %ecx,%eax
  8008dd:	a8 03                	test   $0x3,%al
  8008df:	75 23                	jne    800904 <memset+0x3f>
		c &= 0xFF;
  8008e1:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  8008e5:	89 d3                	mov    %edx,%ebx
  8008e7:	c1 e3 08             	shl    $0x8,%ebx
  8008ea:	89 d0                	mov    %edx,%eax
  8008ec:	c1 e0 18             	shl    $0x18,%eax
  8008ef:	89 d6                	mov    %edx,%esi
  8008f1:	c1 e6 10             	shl    $0x10,%esi
  8008f4:	09 f0                	or     %esi,%eax
  8008f6:	09 c2                	or     %eax,%edx
  8008f8:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  8008fa:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  8008fd:	89 d0                	mov    %edx,%eax
  8008ff:	fc                   	cld    
  800900:	f3 ab                	rep stos %eax,%es:(%edi)
  800902:	eb 06                	jmp    80090a <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  800904:	8b 45 0c             	mov    0xc(%ebp),%eax
  800907:	fc                   	cld    
  800908:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  80090a:	89 f8                	mov    %edi,%eax
  80090c:	5b                   	pop    %ebx
  80090d:	5e                   	pop    %esi
  80090e:	5f                   	pop    %edi
  80090f:	5d                   	pop    %ebp
  800910:	c3                   	ret    

00800911 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800911:	f3 0f 1e fb          	endbr32 
  800915:	55                   	push   %ebp
  800916:	89 e5                	mov    %esp,%ebp
  800918:	57                   	push   %edi
  800919:	56                   	push   %esi
  80091a:	8b 45 08             	mov    0x8(%ebp),%eax
  80091d:	8b 75 0c             	mov    0xc(%ebp),%esi
  800920:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800923:	39 c6                	cmp    %eax,%esi
  800925:	73 32                	jae    800959 <memmove+0x48>
  800927:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  80092a:	39 c2                	cmp    %eax,%edx
  80092c:	76 2b                	jbe    800959 <memmove+0x48>
		s += n;
		d += n;
  80092e:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800931:	89 fe                	mov    %edi,%esi
  800933:	09 ce                	or     %ecx,%esi
  800935:	09 d6                	or     %edx,%esi
  800937:	f7 c6 03 00 00 00    	test   $0x3,%esi
  80093d:	75 0e                	jne    80094d <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  80093f:	83 ef 04             	sub    $0x4,%edi
  800942:	8d 72 fc             	lea    -0x4(%edx),%esi
  800945:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800948:	fd                   	std    
  800949:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80094b:	eb 09                	jmp    800956 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  80094d:	83 ef 01             	sub    $0x1,%edi
  800950:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800953:	fd                   	std    
  800954:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800956:	fc                   	cld    
  800957:	eb 1a                	jmp    800973 <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800959:	89 c2                	mov    %eax,%edx
  80095b:	09 ca                	or     %ecx,%edx
  80095d:	09 f2                	or     %esi,%edx
  80095f:	f6 c2 03             	test   $0x3,%dl
  800962:	75 0a                	jne    80096e <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800964:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800967:	89 c7                	mov    %eax,%edi
  800969:	fc                   	cld    
  80096a:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80096c:	eb 05                	jmp    800973 <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  80096e:	89 c7                	mov    %eax,%edi
  800970:	fc                   	cld    
  800971:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800973:	5e                   	pop    %esi
  800974:	5f                   	pop    %edi
  800975:	5d                   	pop    %ebp
  800976:	c3                   	ret    

00800977 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800977:	f3 0f 1e fb          	endbr32 
  80097b:	55                   	push   %ebp
  80097c:	89 e5                	mov    %esp,%ebp
  80097e:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800981:	ff 75 10             	pushl  0x10(%ebp)
  800984:	ff 75 0c             	pushl  0xc(%ebp)
  800987:	ff 75 08             	pushl  0x8(%ebp)
  80098a:	e8 82 ff ff ff       	call   800911 <memmove>
}
  80098f:	c9                   	leave  
  800990:	c3                   	ret    

00800991 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800991:	f3 0f 1e fb          	endbr32 
  800995:	55                   	push   %ebp
  800996:	89 e5                	mov    %esp,%ebp
  800998:	56                   	push   %esi
  800999:	53                   	push   %ebx
  80099a:	8b 45 08             	mov    0x8(%ebp),%eax
  80099d:	8b 55 0c             	mov    0xc(%ebp),%edx
  8009a0:	89 c6                	mov    %eax,%esi
  8009a2:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  8009a5:	39 f0                	cmp    %esi,%eax
  8009a7:	74 1c                	je     8009c5 <memcmp+0x34>
		if (*s1 != *s2)
  8009a9:	0f b6 08             	movzbl (%eax),%ecx
  8009ac:	0f b6 1a             	movzbl (%edx),%ebx
  8009af:	38 d9                	cmp    %bl,%cl
  8009b1:	75 08                	jne    8009bb <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  8009b3:	83 c0 01             	add    $0x1,%eax
  8009b6:	83 c2 01             	add    $0x1,%edx
  8009b9:	eb ea                	jmp    8009a5 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  8009bb:	0f b6 c1             	movzbl %cl,%eax
  8009be:	0f b6 db             	movzbl %bl,%ebx
  8009c1:	29 d8                	sub    %ebx,%eax
  8009c3:	eb 05                	jmp    8009ca <memcmp+0x39>
	}

	return 0;
  8009c5:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8009ca:	5b                   	pop    %ebx
  8009cb:	5e                   	pop    %esi
  8009cc:	5d                   	pop    %ebp
  8009cd:	c3                   	ret    

008009ce <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  8009ce:	f3 0f 1e fb          	endbr32 
  8009d2:	55                   	push   %ebp
  8009d3:	89 e5                	mov    %esp,%ebp
  8009d5:	8b 45 08             	mov    0x8(%ebp),%eax
  8009d8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  8009db:	89 c2                	mov    %eax,%edx
  8009dd:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  8009e0:	39 d0                	cmp    %edx,%eax
  8009e2:	73 09                	jae    8009ed <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  8009e4:	38 08                	cmp    %cl,(%eax)
  8009e6:	74 05                	je     8009ed <memfind+0x1f>
	for (; s < ends; s++)
  8009e8:	83 c0 01             	add    $0x1,%eax
  8009eb:	eb f3                	jmp    8009e0 <memfind+0x12>
			break;
	return (void *) s;
}
  8009ed:	5d                   	pop    %ebp
  8009ee:	c3                   	ret    

008009ef <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  8009ef:	f3 0f 1e fb          	endbr32 
  8009f3:	55                   	push   %ebp
  8009f4:	89 e5                	mov    %esp,%ebp
  8009f6:	57                   	push   %edi
  8009f7:	56                   	push   %esi
  8009f8:	53                   	push   %ebx
  8009f9:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8009fc:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  8009ff:	eb 03                	jmp    800a04 <strtol+0x15>
		s++;
  800a01:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800a04:	0f b6 01             	movzbl (%ecx),%eax
  800a07:	3c 20                	cmp    $0x20,%al
  800a09:	74 f6                	je     800a01 <strtol+0x12>
  800a0b:	3c 09                	cmp    $0x9,%al
  800a0d:	74 f2                	je     800a01 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800a0f:	3c 2b                	cmp    $0x2b,%al
  800a11:	74 2a                	je     800a3d <strtol+0x4e>
	int neg = 0;
  800a13:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800a18:	3c 2d                	cmp    $0x2d,%al
  800a1a:	74 2b                	je     800a47 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a1c:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800a22:	75 0f                	jne    800a33 <strtol+0x44>
  800a24:	80 39 30             	cmpb   $0x30,(%ecx)
  800a27:	74 28                	je     800a51 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800a29:	85 db                	test   %ebx,%ebx
  800a2b:	b8 0a 00 00 00       	mov    $0xa,%eax
  800a30:	0f 44 d8             	cmove  %eax,%ebx
  800a33:	b8 00 00 00 00       	mov    $0x0,%eax
  800a38:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800a3b:	eb 46                	jmp    800a83 <strtol+0x94>
		s++;
  800a3d:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800a40:	bf 00 00 00 00       	mov    $0x0,%edi
  800a45:	eb d5                	jmp    800a1c <strtol+0x2d>
		s++, neg = 1;
  800a47:	83 c1 01             	add    $0x1,%ecx
  800a4a:	bf 01 00 00 00       	mov    $0x1,%edi
  800a4f:	eb cb                	jmp    800a1c <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a51:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800a55:	74 0e                	je     800a65 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800a57:	85 db                	test   %ebx,%ebx
  800a59:	75 d8                	jne    800a33 <strtol+0x44>
		s++, base = 8;
  800a5b:	83 c1 01             	add    $0x1,%ecx
  800a5e:	bb 08 00 00 00       	mov    $0x8,%ebx
  800a63:	eb ce                	jmp    800a33 <strtol+0x44>
		s += 2, base = 16;
  800a65:	83 c1 02             	add    $0x2,%ecx
  800a68:	bb 10 00 00 00       	mov    $0x10,%ebx
  800a6d:	eb c4                	jmp    800a33 <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800a6f:	0f be d2             	movsbl %dl,%edx
  800a72:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800a75:	3b 55 10             	cmp    0x10(%ebp),%edx
  800a78:	7d 3a                	jge    800ab4 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800a7a:	83 c1 01             	add    $0x1,%ecx
  800a7d:	0f af 45 10          	imul   0x10(%ebp),%eax
  800a81:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800a83:	0f b6 11             	movzbl (%ecx),%edx
  800a86:	8d 72 d0             	lea    -0x30(%edx),%esi
  800a89:	89 f3                	mov    %esi,%ebx
  800a8b:	80 fb 09             	cmp    $0x9,%bl
  800a8e:	76 df                	jbe    800a6f <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800a90:	8d 72 9f             	lea    -0x61(%edx),%esi
  800a93:	89 f3                	mov    %esi,%ebx
  800a95:	80 fb 19             	cmp    $0x19,%bl
  800a98:	77 08                	ja     800aa2 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800a9a:	0f be d2             	movsbl %dl,%edx
  800a9d:	83 ea 57             	sub    $0x57,%edx
  800aa0:	eb d3                	jmp    800a75 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800aa2:	8d 72 bf             	lea    -0x41(%edx),%esi
  800aa5:	89 f3                	mov    %esi,%ebx
  800aa7:	80 fb 19             	cmp    $0x19,%bl
  800aaa:	77 08                	ja     800ab4 <strtol+0xc5>
			dig = *s - 'A' + 10;
  800aac:	0f be d2             	movsbl %dl,%edx
  800aaf:	83 ea 37             	sub    $0x37,%edx
  800ab2:	eb c1                	jmp    800a75 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800ab4:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800ab8:	74 05                	je     800abf <strtol+0xd0>
		*endptr = (char *) s;
  800aba:	8b 75 0c             	mov    0xc(%ebp),%esi
  800abd:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800abf:	89 c2                	mov    %eax,%edx
  800ac1:	f7 da                	neg    %edx
  800ac3:	85 ff                	test   %edi,%edi
  800ac5:	0f 45 c2             	cmovne %edx,%eax
}
  800ac8:	5b                   	pop    %ebx
  800ac9:	5e                   	pop    %esi
  800aca:	5f                   	pop    %edi
  800acb:	5d                   	pop    %ebp
  800acc:	c3                   	ret    

00800acd <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800acd:	f3 0f 1e fb          	endbr32 
  800ad1:	55                   	push   %ebp
  800ad2:	89 e5                	mov    %esp,%ebp
  800ad4:	57                   	push   %edi
  800ad5:	56                   	push   %esi
  800ad6:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ad7:	b8 00 00 00 00       	mov    $0x0,%eax
  800adc:	8b 55 08             	mov    0x8(%ebp),%edx
  800adf:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ae2:	89 c3                	mov    %eax,%ebx
  800ae4:	89 c7                	mov    %eax,%edi
  800ae6:	89 c6                	mov    %eax,%esi
  800ae8:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800aea:	5b                   	pop    %ebx
  800aeb:	5e                   	pop    %esi
  800aec:	5f                   	pop    %edi
  800aed:	5d                   	pop    %ebp
  800aee:	c3                   	ret    

00800aef <sys_cgetc>:

int
sys_cgetc(void)
{
  800aef:	f3 0f 1e fb          	endbr32 
  800af3:	55                   	push   %ebp
  800af4:	89 e5                	mov    %esp,%ebp
  800af6:	57                   	push   %edi
  800af7:	56                   	push   %esi
  800af8:	53                   	push   %ebx
	asm volatile("int %1\n"
  800af9:	ba 00 00 00 00       	mov    $0x0,%edx
  800afe:	b8 01 00 00 00       	mov    $0x1,%eax
  800b03:	89 d1                	mov    %edx,%ecx
  800b05:	89 d3                	mov    %edx,%ebx
  800b07:	89 d7                	mov    %edx,%edi
  800b09:	89 d6                	mov    %edx,%esi
  800b0b:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800b0d:	5b                   	pop    %ebx
  800b0e:	5e                   	pop    %esi
  800b0f:	5f                   	pop    %edi
  800b10:	5d                   	pop    %ebp
  800b11:	c3                   	ret    

00800b12 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800b12:	f3 0f 1e fb          	endbr32 
  800b16:	55                   	push   %ebp
  800b17:	89 e5                	mov    %esp,%ebp
  800b19:	57                   	push   %edi
  800b1a:	56                   	push   %esi
  800b1b:	53                   	push   %ebx
  800b1c:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800b1f:	b9 00 00 00 00       	mov    $0x0,%ecx
  800b24:	8b 55 08             	mov    0x8(%ebp),%edx
  800b27:	b8 03 00 00 00       	mov    $0x3,%eax
  800b2c:	89 cb                	mov    %ecx,%ebx
  800b2e:	89 cf                	mov    %ecx,%edi
  800b30:	89 ce                	mov    %ecx,%esi
  800b32:	cd 30                	int    $0x30
	if(check && ret > 0)
  800b34:	85 c0                	test   %eax,%eax
  800b36:	7f 08                	jg     800b40 <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800b38:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800b3b:	5b                   	pop    %ebx
  800b3c:	5e                   	pop    %esi
  800b3d:	5f                   	pop    %edi
  800b3e:	5d                   	pop    %ebp
  800b3f:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800b40:	83 ec 0c             	sub    $0xc,%esp
  800b43:	50                   	push   %eax
  800b44:	6a 03                	push   $0x3
  800b46:	68 3f 22 80 00       	push   $0x80223f
  800b4b:	6a 23                	push   $0x23
  800b4d:	68 5c 22 80 00       	push   $0x80225c
  800b52:	e8 9c 0f 00 00       	call   801af3 <_panic>

00800b57 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800b57:	f3 0f 1e fb          	endbr32 
  800b5b:	55                   	push   %ebp
  800b5c:	89 e5                	mov    %esp,%ebp
  800b5e:	57                   	push   %edi
  800b5f:	56                   	push   %esi
  800b60:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b61:	ba 00 00 00 00       	mov    $0x0,%edx
  800b66:	b8 02 00 00 00       	mov    $0x2,%eax
  800b6b:	89 d1                	mov    %edx,%ecx
  800b6d:	89 d3                	mov    %edx,%ebx
  800b6f:	89 d7                	mov    %edx,%edi
  800b71:	89 d6                	mov    %edx,%esi
  800b73:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800b75:	5b                   	pop    %ebx
  800b76:	5e                   	pop    %esi
  800b77:	5f                   	pop    %edi
  800b78:	5d                   	pop    %ebp
  800b79:	c3                   	ret    

00800b7a <sys_yield>:

void
sys_yield(void)
{
  800b7a:	f3 0f 1e fb          	endbr32 
  800b7e:	55                   	push   %ebp
  800b7f:	89 e5                	mov    %esp,%ebp
  800b81:	57                   	push   %edi
  800b82:	56                   	push   %esi
  800b83:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b84:	ba 00 00 00 00       	mov    $0x0,%edx
  800b89:	b8 0b 00 00 00       	mov    $0xb,%eax
  800b8e:	89 d1                	mov    %edx,%ecx
  800b90:	89 d3                	mov    %edx,%ebx
  800b92:	89 d7                	mov    %edx,%edi
  800b94:	89 d6                	mov    %edx,%esi
  800b96:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800b98:	5b                   	pop    %ebx
  800b99:	5e                   	pop    %esi
  800b9a:	5f                   	pop    %edi
  800b9b:	5d                   	pop    %ebp
  800b9c:	c3                   	ret    

00800b9d <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800b9d:	f3 0f 1e fb          	endbr32 
  800ba1:	55                   	push   %ebp
  800ba2:	89 e5                	mov    %esp,%ebp
  800ba4:	57                   	push   %edi
  800ba5:	56                   	push   %esi
  800ba6:	53                   	push   %ebx
  800ba7:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800baa:	be 00 00 00 00       	mov    $0x0,%esi
  800baf:	8b 55 08             	mov    0x8(%ebp),%edx
  800bb2:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800bb5:	b8 04 00 00 00       	mov    $0x4,%eax
  800bba:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800bbd:	89 f7                	mov    %esi,%edi
  800bbf:	cd 30                	int    $0x30
	if(check && ret > 0)
  800bc1:	85 c0                	test   %eax,%eax
  800bc3:	7f 08                	jg     800bcd <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800bc5:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bc8:	5b                   	pop    %ebx
  800bc9:	5e                   	pop    %esi
  800bca:	5f                   	pop    %edi
  800bcb:	5d                   	pop    %ebp
  800bcc:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800bcd:	83 ec 0c             	sub    $0xc,%esp
  800bd0:	50                   	push   %eax
  800bd1:	6a 04                	push   $0x4
  800bd3:	68 3f 22 80 00       	push   $0x80223f
  800bd8:	6a 23                	push   $0x23
  800bda:	68 5c 22 80 00       	push   $0x80225c
  800bdf:	e8 0f 0f 00 00       	call   801af3 <_panic>

00800be4 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800be4:	f3 0f 1e fb          	endbr32 
  800be8:	55                   	push   %ebp
  800be9:	89 e5                	mov    %esp,%ebp
  800beb:	57                   	push   %edi
  800bec:	56                   	push   %esi
  800bed:	53                   	push   %ebx
  800bee:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800bf1:	8b 55 08             	mov    0x8(%ebp),%edx
  800bf4:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800bf7:	b8 05 00 00 00       	mov    $0x5,%eax
  800bfc:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800bff:	8b 7d 14             	mov    0x14(%ebp),%edi
  800c02:	8b 75 18             	mov    0x18(%ebp),%esi
  800c05:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c07:	85 c0                	test   %eax,%eax
  800c09:	7f 08                	jg     800c13 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800c0b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c0e:	5b                   	pop    %ebx
  800c0f:	5e                   	pop    %esi
  800c10:	5f                   	pop    %edi
  800c11:	5d                   	pop    %ebp
  800c12:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c13:	83 ec 0c             	sub    $0xc,%esp
  800c16:	50                   	push   %eax
  800c17:	6a 05                	push   $0x5
  800c19:	68 3f 22 80 00       	push   $0x80223f
  800c1e:	6a 23                	push   $0x23
  800c20:	68 5c 22 80 00       	push   $0x80225c
  800c25:	e8 c9 0e 00 00       	call   801af3 <_panic>

00800c2a <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800c2a:	f3 0f 1e fb          	endbr32 
  800c2e:	55                   	push   %ebp
  800c2f:	89 e5                	mov    %esp,%ebp
  800c31:	57                   	push   %edi
  800c32:	56                   	push   %esi
  800c33:	53                   	push   %ebx
  800c34:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c37:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c3c:	8b 55 08             	mov    0x8(%ebp),%edx
  800c3f:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c42:	b8 06 00 00 00       	mov    $0x6,%eax
  800c47:	89 df                	mov    %ebx,%edi
  800c49:	89 de                	mov    %ebx,%esi
  800c4b:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c4d:	85 c0                	test   %eax,%eax
  800c4f:	7f 08                	jg     800c59 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800c51:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c54:	5b                   	pop    %ebx
  800c55:	5e                   	pop    %esi
  800c56:	5f                   	pop    %edi
  800c57:	5d                   	pop    %ebp
  800c58:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c59:	83 ec 0c             	sub    $0xc,%esp
  800c5c:	50                   	push   %eax
  800c5d:	6a 06                	push   $0x6
  800c5f:	68 3f 22 80 00       	push   $0x80223f
  800c64:	6a 23                	push   $0x23
  800c66:	68 5c 22 80 00       	push   $0x80225c
  800c6b:	e8 83 0e 00 00       	call   801af3 <_panic>

00800c70 <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800c70:	f3 0f 1e fb          	endbr32 
  800c74:	55                   	push   %ebp
  800c75:	89 e5                	mov    %esp,%ebp
  800c77:	57                   	push   %edi
  800c78:	56                   	push   %esi
  800c79:	53                   	push   %ebx
  800c7a:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c7d:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c82:	8b 55 08             	mov    0x8(%ebp),%edx
  800c85:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c88:	b8 08 00 00 00       	mov    $0x8,%eax
  800c8d:	89 df                	mov    %ebx,%edi
  800c8f:	89 de                	mov    %ebx,%esi
  800c91:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c93:	85 c0                	test   %eax,%eax
  800c95:	7f 08                	jg     800c9f <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800c97:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c9a:	5b                   	pop    %ebx
  800c9b:	5e                   	pop    %esi
  800c9c:	5f                   	pop    %edi
  800c9d:	5d                   	pop    %ebp
  800c9e:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c9f:	83 ec 0c             	sub    $0xc,%esp
  800ca2:	50                   	push   %eax
  800ca3:	6a 08                	push   $0x8
  800ca5:	68 3f 22 80 00       	push   $0x80223f
  800caa:	6a 23                	push   $0x23
  800cac:	68 5c 22 80 00       	push   $0x80225c
  800cb1:	e8 3d 0e 00 00       	call   801af3 <_panic>

00800cb6 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800cb6:	f3 0f 1e fb          	endbr32 
  800cba:	55                   	push   %ebp
  800cbb:	89 e5                	mov    %esp,%ebp
  800cbd:	57                   	push   %edi
  800cbe:	56                   	push   %esi
  800cbf:	53                   	push   %ebx
  800cc0:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cc3:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cc8:	8b 55 08             	mov    0x8(%ebp),%edx
  800ccb:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cce:	b8 09 00 00 00       	mov    $0x9,%eax
  800cd3:	89 df                	mov    %ebx,%edi
  800cd5:	89 de                	mov    %ebx,%esi
  800cd7:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cd9:	85 c0                	test   %eax,%eax
  800cdb:	7f 08                	jg     800ce5 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800cdd:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ce0:	5b                   	pop    %ebx
  800ce1:	5e                   	pop    %esi
  800ce2:	5f                   	pop    %edi
  800ce3:	5d                   	pop    %ebp
  800ce4:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800ce5:	83 ec 0c             	sub    $0xc,%esp
  800ce8:	50                   	push   %eax
  800ce9:	6a 09                	push   $0x9
  800ceb:	68 3f 22 80 00       	push   $0x80223f
  800cf0:	6a 23                	push   $0x23
  800cf2:	68 5c 22 80 00       	push   $0x80225c
  800cf7:	e8 f7 0d 00 00       	call   801af3 <_panic>

00800cfc <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800cfc:	f3 0f 1e fb          	endbr32 
  800d00:	55                   	push   %ebp
  800d01:	89 e5                	mov    %esp,%ebp
  800d03:	57                   	push   %edi
  800d04:	56                   	push   %esi
  800d05:	53                   	push   %ebx
  800d06:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d09:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d0e:	8b 55 08             	mov    0x8(%ebp),%edx
  800d11:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d14:	b8 0a 00 00 00       	mov    $0xa,%eax
  800d19:	89 df                	mov    %ebx,%edi
  800d1b:	89 de                	mov    %ebx,%esi
  800d1d:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d1f:	85 c0                	test   %eax,%eax
  800d21:	7f 08                	jg     800d2b <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800d23:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d26:	5b                   	pop    %ebx
  800d27:	5e                   	pop    %esi
  800d28:	5f                   	pop    %edi
  800d29:	5d                   	pop    %ebp
  800d2a:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d2b:	83 ec 0c             	sub    $0xc,%esp
  800d2e:	50                   	push   %eax
  800d2f:	6a 0a                	push   $0xa
  800d31:	68 3f 22 80 00       	push   $0x80223f
  800d36:	6a 23                	push   $0x23
  800d38:	68 5c 22 80 00       	push   $0x80225c
  800d3d:	e8 b1 0d 00 00       	call   801af3 <_panic>

00800d42 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800d42:	f3 0f 1e fb          	endbr32 
  800d46:	55                   	push   %ebp
  800d47:	89 e5                	mov    %esp,%ebp
  800d49:	57                   	push   %edi
  800d4a:	56                   	push   %esi
  800d4b:	53                   	push   %ebx
	asm volatile("int %1\n"
  800d4c:	8b 55 08             	mov    0x8(%ebp),%edx
  800d4f:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d52:	b8 0c 00 00 00       	mov    $0xc,%eax
  800d57:	be 00 00 00 00       	mov    $0x0,%esi
  800d5c:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800d5f:	8b 7d 14             	mov    0x14(%ebp),%edi
  800d62:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800d64:	5b                   	pop    %ebx
  800d65:	5e                   	pop    %esi
  800d66:	5f                   	pop    %edi
  800d67:	5d                   	pop    %ebp
  800d68:	c3                   	ret    

00800d69 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800d69:	f3 0f 1e fb          	endbr32 
  800d6d:	55                   	push   %ebp
  800d6e:	89 e5                	mov    %esp,%ebp
  800d70:	57                   	push   %edi
  800d71:	56                   	push   %esi
  800d72:	53                   	push   %ebx
  800d73:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d76:	b9 00 00 00 00       	mov    $0x0,%ecx
  800d7b:	8b 55 08             	mov    0x8(%ebp),%edx
  800d7e:	b8 0d 00 00 00       	mov    $0xd,%eax
  800d83:	89 cb                	mov    %ecx,%ebx
  800d85:	89 cf                	mov    %ecx,%edi
  800d87:	89 ce                	mov    %ecx,%esi
  800d89:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d8b:	85 c0                	test   %eax,%eax
  800d8d:	7f 08                	jg     800d97 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800d8f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d92:	5b                   	pop    %ebx
  800d93:	5e                   	pop    %esi
  800d94:	5f                   	pop    %edi
  800d95:	5d                   	pop    %ebp
  800d96:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d97:	83 ec 0c             	sub    $0xc,%esp
  800d9a:	50                   	push   %eax
  800d9b:	6a 0d                	push   $0xd
  800d9d:	68 3f 22 80 00       	push   $0x80223f
  800da2:	6a 23                	push   $0x23
  800da4:	68 5c 22 80 00       	push   $0x80225c
  800da9:	e8 45 0d 00 00       	call   801af3 <_panic>

00800dae <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800dae:	f3 0f 1e fb          	endbr32 
  800db2:	55                   	push   %ebp
  800db3:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800db5:	8b 45 08             	mov    0x8(%ebp),%eax
  800db8:	05 00 00 00 30       	add    $0x30000000,%eax
  800dbd:	c1 e8 0c             	shr    $0xc,%eax
}
  800dc0:	5d                   	pop    %ebp
  800dc1:	c3                   	ret    

00800dc2 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800dc2:	f3 0f 1e fb          	endbr32 
  800dc6:	55                   	push   %ebp
  800dc7:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800dc9:	8b 45 08             	mov    0x8(%ebp),%eax
  800dcc:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800dd1:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800dd6:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800ddb:	5d                   	pop    %ebp
  800ddc:	c3                   	ret    

00800ddd <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800ddd:	f3 0f 1e fb          	endbr32 
  800de1:	55                   	push   %ebp
  800de2:	89 e5                	mov    %esp,%ebp
  800de4:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800de9:	89 c2                	mov    %eax,%edx
  800deb:	c1 ea 16             	shr    $0x16,%edx
  800dee:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800df5:	f6 c2 01             	test   $0x1,%dl
  800df8:	74 2d                	je     800e27 <fd_alloc+0x4a>
  800dfa:	89 c2                	mov    %eax,%edx
  800dfc:	c1 ea 0c             	shr    $0xc,%edx
  800dff:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800e06:	f6 c2 01             	test   $0x1,%dl
  800e09:	74 1c                	je     800e27 <fd_alloc+0x4a>
  800e0b:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800e10:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800e15:	75 d2                	jne    800de9 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800e17:	8b 45 08             	mov    0x8(%ebp),%eax
  800e1a:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800e20:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800e25:	eb 0a                	jmp    800e31 <fd_alloc+0x54>
			*fd_store = fd;
  800e27:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e2a:	89 01                	mov    %eax,(%ecx)
			return 0;
  800e2c:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e31:	5d                   	pop    %ebp
  800e32:	c3                   	ret    

00800e33 <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800e33:	f3 0f 1e fb          	endbr32 
  800e37:	55                   	push   %ebp
  800e38:	89 e5                	mov    %esp,%ebp
  800e3a:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800e3d:	83 f8 1f             	cmp    $0x1f,%eax
  800e40:	77 30                	ja     800e72 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800e42:	c1 e0 0c             	shl    $0xc,%eax
  800e45:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800e4a:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800e50:	f6 c2 01             	test   $0x1,%dl
  800e53:	74 24                	je     800e79 <fd_lookup+0x46>
  800e55:	89 c2                	mov    %eax,%edx
  800e57:	c1 ea 0c             	shr    $0xc,%edx
  800e5a:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800e61:	f6 c2 01             	test   $0x1,%dl
  800e64:	74 1a                	je     800e80 <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800e66:	8b 55 0c             	mov    0xc(%ebp),%edx
  800e69:	89 02                	mov    %eax,(%edx)
	return 0;
  800e6b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e70:	5d                   	pop    %ebp
  800e71:	c3                   	ret    
		return -E_INVAL;
  800e72:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e77:	eb f7                	jmp    800e70 <fd_lookup+0x3d>
		return -E_INVAL;
  800e79:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e7e:	eb f0                	jmp    800e70 <fd_lookup+0x3d>
  800e80:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e85:	eb e9                	jmp    800e70 <fd_lookup+0x3d>

00800e87 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800e87:	f3 0f 1e fb          	endbr32 
  800e8b:	55                   	push   %ebp
  800e8c:	89 e5                	mov    %esp,%ebp
  800e8e:	83 ec 08             	sub    $0x8,%esp
  800e91:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e94:	ba e8 22 80 00       	mov    $0x8022e8,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800e99:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800e9e:	39 08                	cmp    %ecx,(%eax)
  800ea0:	74 33                	je     800ed5 <dev_lookup+0x4e>
  800ea2:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800ea5:	8b 02                	mov    (%edx),%eax
  800ea7:	85 c0                	test   %eax,%eax
  800ea9:	75 f3                	jne    800e9e <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800eab:	a1 04 40 80 00       	mov    0x804004,%eax
  800eb0:	8b 40 48             	mov    0x48(%eax),%eax
  800eb3:	83 ec 04             	sub    $0x4,%esp
  800eb6:	51                   	push   %ecx
  800eb7:	50                   	push   %eax
  800eb8:	68 6c 22 80 00       	push   $0x80226c
  800ebd:	e8 c0 f2 ff ff       	call   800182 <cprintf>
	*dev = 0;
  800ec2:	8b 45 0c             	mov    0xc(%ebp),%eax
  800ec5:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  800ecb:	83 c4 10             	add    $0x10,%esp
  800ece:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800ed3:	c9                   	leave  
  800ed4:	c3                   	ret    
			*dev = devtab[i];
  800ed5:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ed8:	89 01                	mov    %eax,(%ecx)
			return 0;
  800eda:	b8 00 00 00 00       	mov    $0x0,%eax
  800edf:	eb f2                	jmp    800ed3 <dev_lookup+0x4c>

00800ee1 <fd_close>:
{
  800ee1:	f3 0f 1e fb          	endbr32 
  800ee5:	55                   	push   %ebp
  800ee6:	89 e5                	mov    %esp,%ebp
  800ee8:	57                   	push   %edi
  800ee9:	56                   	push   %esi
  800eea:	53                   	push   %ebx
  800eeb:	83 ec 24             	sub    $0x24,%esp
  800eee:	8b 75 08             	mov    0x8(%ebp),%esi
  800ef1:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800ef4:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800ef7:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800ef8:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  800efe:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800f01:	50                   	push   %eax
  800f02:	e8 2c ff ff ff       	call   800e33 <fd_lookup>
  800f07:	89 c3                	mov    %eax,%ebx
  800f09:	83 c4 10             	add    $0x10,%esp
  800f0c:	85 c0                	test   %eax,%eax
  800f0e:	78 05                	js     800f15 <fd_close+0x34>
	    || fd != fd2)
  800f10:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  800f13:	74 16                	je     800f2b <fd_close+0x4a>
		return (must_exist ? r : 0);
  800f15:	89 f8                	mov    %edi,%eax
  800f17:	84 c0                	test   %al,%al
  800f19:	b8 00 00 00 00       	mov    $0x0,%eax
  800f1e:	0f 44 d8             	cmove  %eax,%ebx
}
  800f21:	89 d8                	mov    %ebx,%eax
  800f23:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f26:	5b                   	pop    %ebx
  800f27:	5e                   	pop    %esi
  800f28:	5f                   	pop    %edi
  800f29:	5d                   	pop    %ebp
  800f2a:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  800f2b:	83 ec 08             	sub    $0x8,%esp
  800f2e:	8d 45 e0             	lea    -0x20(%ebp),%eax
  800f31:	50                   	push   %eax
  800f32:	ff 36                	pushl  (%esi)
  800f34:	e8 4e ff ff ff       	call   800e87 <dev_lookup>
  800f39:	89 c3                	mov    %eax,%ebx
  800f3b:	83 c4 10             	add    $0x10,%esp
  800f3e:	85 c0                	test   %eax,%eax
  800f40:	78 1a                	js     800f5c <fd_close+0x7b>
		if (dev->dev_close)
  800f42:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800f45:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  800f48:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  800f4d:	85 c0                	test   %eax,%eax
  800f4f:	74 0b                	je     800f5c <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  800f51:	83 ec 0c             	sub    $0xc,%esp
  800f54:	56                   	push   %esi
  800f55:	ff d0                	call   *%eax
  800f57:	89 c3                	mov    %eax,%ebx
  800f59:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  800f5c:	83 ec 08             	sub    $0x8,%esp
  800f5f:	56                   	push   %esi
  800f60:	6a 00                	push   $0x0
  800f62:	e8 c3 fc ff ff       	call   800c2a <sys_page_unmap>
	return r;
  800f67:	83 c4 10             	add    $0x10,%esp
  800f6a:	eb b5                	jmp    800f21 <fd_close+0x40>

00800f6c <close>:

int
close(int fdnum)
{
  800f6c:	f3 0f 1e fb          	endbr32 
  800f70:	55                   	push   %ebp
  800f71:	89 e5                	mov    %esp,%ebp
  800f73:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800f76:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800f79:	50                   	push   %eax
  800f7a:	ff 75 08             	pushl  0x8(%ebp)
  800f7d:	e8 b1 fe ff ff       	call   800e33 <fd_lookup>
  800f82:	83 c4 10             	add    $0x10,%esp
  800f85:	85 c0                	test   %eax,%eax
  800f87:	79 02                	jns    800f8b <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  800f89:	c9                   	leave  
  800f8a:	c3                   	ret    
		return fd_close(fd, 1);
  800f8b:	83 ec 08             	sub    $0x8,%esp
  800f8e:	6a 01                	push   $0x1
  800f90:	ff 75 f4             	pushl  -0xc(%ebp)
  800f93:	e8 49 ff ff ff       	call   800ee1 <fd_close>
  800f98:	83 c4 10             	add    $0x10,%esp
  800f9b:	eb ec                	jmp    800f89 <close+0x1d>

00800f9d <close_all>:

void
close_all(void)
{
  800f9d:	f3 0f 1e fb          	endbr32 
  800fa1:	55                   	push   %ebp
  800fa2:	89 e5                	mov    %esp,%ebp
  800fa4:	53                   	push   %ebx
  800fa5:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  800fa8:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  800fad:	83 ec 0c             	sub    $0xc,%esp
  800fb0:	53                   	push   %ebx
  800fb1:	e8 b6 ff ff ff       	call   800f6c <close>
	for (i = 0; i < MAXFD; i++)
  800fb6:	83 c3 01             	add    $0x1,%ebx
  800fb9:	83 c4 10             	add    $0x10,%esp
  800fbc:	83 fb 20             	cmp    $0x20,%ebx
  800fbf:	75 ec                	jne    800fad <close_all+0x10>
}
  800fc1:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800fc4:	c9                   	leave  
  800fc5:	c3                   	ret    

00800fc6 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  800fc6:	f3 0f 1e fb          	endbr32 
  800fca:	55                   	push   %ebp
  800fcb:	89 e5                	mov    %esp,%ebp
  800fcd:	57                   	push   %edi
  800fce:	56                   	push   %esi
  800fcf:	53                   	push   %ebx
  800fd0:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  800fd3:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800fd6:	50                   	push   %eax
  800fd7:	ff 75 08             	pushl  0x8(%ebp)
  800fda:	e8 54 fe ff ff       	call   800e33 <fd_lookup>
  800fdf:	89 c3                	mov    %eax,%ebx
  800fe1:	83 c4 10             	add    $0x10,%esp
  800fe4:	85 c0                	test   %eax,%eax
  800fe6:	0f 88 81 00 00 00    	js     80106d <dup+0xa7>
		return r;
	close(newfdnum);
  800fec:	83 ec 0c             	sub    $0xc,%esp
  800fef:	ff 75 0c             	pushl  0xc(%ebp)
  800ff2:	e8 75 ff ff ff       	call   800f6c <close>

	newfd = INDEX2FD(newfdnum);
  800ff7:	8b 75 0c             	mov    0xc(%ebp),%esi
  800ffa:	c1 e6 0c             	shl    $0xc,%esi
  800ffd:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  801003:	83 c4 04             	add    $0x4,%esp
  801006:	ff 75 e4             	pushl  -0x1c(%ebp)
  801009:	e8 b4 fd ff ff       	call   800dc2 <fd2data>
  80100e:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  801010:	89 34 24             	mov    %esi,(%esp)
  801013:	e8 aa fd ff ff       	call   800dc2 <fd2data>
  801018:	83 c4 10             	add    $0x10,%esp
  80101b:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  80101d:	89 d8                	mov    %ebx,%eax
  80101f:	c1 e8 16             	shr    $0x16,%eax
  801022:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801029:	a8 01                	test   $0x1,%al
  80102b:	74 11                	je     80103e <dup+0x78>
  80102d:	89 d8                	mov    %ebx,%eax
  80102f:	c1 e8 0c             	shr    $0xc,%eax
  801032:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801039:	f6 c2 01             	test   $0x1,%dl
  80103c:	75 39                	jne    801077 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  80103e:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  801041:	89 d0                	mov    %edx,%eax
  801043:	c1 e8 0c             	shr    $0xc,%eax
  801046:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80104d:	83 ec 0c             	sub    $0xc,%esp
  801050:	25 07 0e 00 00       	and    $0xe07,%eax
  801055:	50                   	push   %eax
  801056:	56                   	push   %esi
  801057:	6a 00                	push   $0x0
  801059:	52                   	push   %edx
  80105a:	6a 00                	push   $0x0
  80105c:	e8 83 fb ff ff       	call   800be4 <sys_page_map>
  801061:	89 c3                	mov    %eax,%ebx
  801063:	83 c4 20             	add    $0x20,%esp
  801066:	85 c0                	test   %eax,%eax
  801068:	78 31                	js     80109b <dup+0xd5>
		goto err;

	return newfdnum;
  80106a:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  80106d:	89 d8                	mov    %ebx,%eax
  80106f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801072:	5b                   	pop    %ebx
  801073:	5e                   	pop    %esi
  801074:	5f                   	pop    %edi
  801075:	5d                   	pop    %ebp
  801076:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  801077:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80107e:	83 ec 0c             	sub    $0xc,%esp
  801081:	25 07 0e 00 00       	and    $0xe07,%eax
  801086:	50                   	push   %eax
  801087:	57                   	push   %edi
  801088:	6a 00                	push   $0x0
  80108a:	53                   	push   %ebx
  80108b:	6a 00                	push   $0x0
  80108d:	e8 52 fb ff ff       	call   800be4 <sys_page_map>
  801092:	89 c3                	mov    %eax,%ebx
  801094:	83 c4 20             	add    $0x20,%esp
  801097:	85 c0                	test   %eax,%eax
  801099:	79 a3                	jns    80103e <dup+0x78>
	sys_page_unmap(0, newfd);
  80109b:	83 ec 08             	sub    $0x8,%esp
  80109e:	56                   	push   %esi
  80109f:	6a 00                	push   $0x0
  8010a1:	e8 84 fb ff ff       	call   800c2a <sys_page_unmap>
	sys_page_unmap(0, nva);
  8010a6:	83 c4 08             	add    $0x8,%esp
  8010a9:	57                   	push   %edi
  8010aa:	6a 00                	push   $0x0
  8010ac:	e8 79 fb ff ff       	call   800c2a <sys_page_unmap>
	return r;
  8010b1:	83 c4 10             	add    $0x10,%esp
  8010b4:	eb b7                	jmp    80106d <dup+0xa7>

008010b6 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8010b6:	f3 0f 1e fb          	endbr32 
  8010ba:	55                   	push   %ebp
  8010bb:	89 e5                	mov    %esp,%ebp
  8010bd:	53                   	push   %ebx
  8010be:	83 ec 1c             	sub    $0x1c,%esp
  8010c1:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8010c4:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8010c7:	50                   	push   %eax
  8010c8:	53                   	push   %ebx
  8010c9:	e8 65 fd ff ff       	call   800e33 <fd_lookup>
  8010ce:	83 c4 10             	add    $0x10,%esp
  8010d1:	85 c0                	test   %eax,%eax
  8010d3:	78 3f                	js     801114 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8010d5:	83 ec 08             	sub    $0x8,%esp
  8010d8:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8010db:	50                   	push   %eax
  8010dc:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8010df:	ff 30                	pushl  (%eax)
  8010e1:	e8 a1 fd ff ff       	call   800e87 <dev_lookup>
  8010e6:	83 c4 10             	add    $0x10,%esp
  8010e9:	85 c0                	test   %eax,%eax
  8010eb:	78 27                	js     801114 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8010ed:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8010f0:	8b 42 08             	mov    0x8(%edx),%eax
  8010f3:	83 e0 03             	and    $0x3,%eax
  8010f6:	83 f8 01             	cmp    $0x1,%eax
  8010f9:	74 1e                	je     801119 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  8010fb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8010fe:	8b 40 08             	mov    0x8(%eax),%eax
  801101:	85 c0                	test   %eax,%eax
  801103:	74 35                	je     80113a <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  801105:	83 ec 04             	sub    $0x4,%esp
  801108:	ff 75 10             	pushl  0x10(%ebp)
  80110b:	ff 75 0c             	pushl  0xc(%ebp)
  80110e:	52                   	push   %edx
  80110f:	ff d0                	call   *%eax
  801111:	83 c4 10             	add    $0x10,%esp
}
  801114:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801117:	c9                   	leave  
  801118:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  801119:	a1 04 40 80 00       	mov    0x804004,%eax
  80111e:	8b 40 48             	mov    0x48(%eax),%eax
  801121:	83 ec 04             	sub    $0x4,%esp
  801124:	53                   	push   %ebx
  801125:	50                   	push   %eax
  801126:	68 ad 22 80 00       	push   $0x8022ad
  80112b:	e8 52 f0 ff ff       	call   800182 <cprintf>
		return -E_INVAL;
  801130:	83 c4 10             	add    $0x10,%esp
  801133:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801138:	eb da                	jmp    801114 <read+0x5e>
		return -E_NOT_SUPP;
  80113a:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80113f:	eb d3                	jmp    801114 <read+0x5e>

00801141 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  801141:	f3 0f 1e fb          	endbr32 
  801145:	55                   	push   %ebp
  801146:	89 e5                	mov    %esp,%ebp
  801148:	57                   	push   %edi
  801149:	56                   	push   %esi
  80114a:	53                   	push   %ebx
  80114b:	83 ec 0c             	sub    $0xc,%esp
  80114e:	8b 7d 08             	mov    0x8(%ebp),%edi
  801151:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  801154:	bb 00 00 00 00       	mov    $0x0,%ebx
  801159:	eb 02                	jmp    80115d <readn+0x1c>
  80115b:	01 c3                	add    %eax,%ebx
  80115d:	39 f3                	cmp    %esi,%ebx
  80115f:	73 21                	jae    801182 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801161:	83 ec 04             	sub    $0x4,%esp
  801164:	89 f0                	mov    %esi,%eax
  801166:	29 d8                	sub    %ebx,%eax
  801168:	50                   	push   %eax
  801169:	89 d8                	mov    %ebx,%eax
  80116b:	03 45 0c             	add    0xc(%ebp),%eax
  80116e:	50                   	push   %eax
  80116f:	57                   	push   %edi
  801170:	e8 41 ff ff ff       	call   8010b6 <read>
		if (m < 0)
  801175:	83 c4 10             	add    $0x10,%esp
  801178:	85 c0                	test   %eax,%eax
  80117a:	78 04                	js     801180 <readn+0x3f>
			return m;
		if (m == 0)
  80117c:	75 dd                	jne    80115b <readn+0x1a>
  80117e:	eb 02                	jmp    801182 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801180:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  801182:	89 d8                	mov    %ebx,%eax
  801184:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801187:	5b                   	pop    %ebx
  801188:	5e                   	pop    %esi
  801189:	5f                   	pop    %edi
  80118a:	5d                   	pop    %ebp
  80118b:	c3                   	ret    

0080118c <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  80118c:	f3 0f 1e fb          	endbr32 
  801190:	55                   	push   %ebp
  801191:	89 e5                	mov    %esp,%ebp
  801193:	53                   	push   %ebx
  801194:	83 ec 1c             	sub    $0x1c,%esp
  801197:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  80119a:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80119d:	50                   	push   %eax
  80119e:	53                   	push   %ebx
  80119f:	e8 8f fc ff ff       	call   800e33 <fd_lookup>
  8011a4:	83 c4 10             	add    $0x10,%esp
  8011a7:	85 c0                	test   %eax,%eax
  8011a9:	78 3a                	js     8011e5 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8011ab:	83 ec 08             	sub    $0x8,%esp
  8011ae:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8011b1:	50                   	push   %eax
  8011b2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011b5:	ff 30                	pushl  (%eax)
  8011b7:	e8 cb fc ff ff       	call   800e87 <dev_lookup>
  8011bc:	83 c4 10             	add    $0x10,%esp
  8011bf:	85 c0                	test   %eax,%eax
  8011c1:	78 22                	js     8011e5 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8011c3:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011c6:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8011ca:	74 1e                	je     8011ea <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8011cc:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8011cf:	8b 52 0c             	mov    0xc(%edx),%edx
  8011d2:	85 d2                	test   %edx,%edx
  8011d4:	74 35                	je     80120b <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  8011d6:	83 ec 04             	sub    $0x4,%esp
  8011d9:	ff 75 10             	pushl  0x10(%ebp)
  8011dc:	ff 75 0c             	pushl  0xc(%ebp)
  8011df:	50                   	push   %eax
  8011e0:	ff d2                	call   *%edx
  8011e2:	83 c4 10             	add    $0x10,%esp
}
  8011e5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8011e8:	c9                   	leave  
  8011e9:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  8011ea:	a1 04 40 80 00       	mov    0x804004,%eax
  8011ef:	8b 40 48             	mov    0x48(%eax),%eax
  8011f2:	83 ec 04             	sub    $0x4,%esp
  8011f5:	53                   	push   %ebx
  8011f6:	50                   	push   %eax
  8011f7:	68 c9 22 80 00       	push   $0x8022c9
  8011fc:	e8 81 ef ff ff       	call   800182 <cprintf>
		return -E_INVAL;
  801201:	83 c4 10             	add    $0x10,%esp
  801204:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801209:	eb da                	jmp    8011e5 <write+0x59>
		return -E_NOT_SUPP;
  80120b:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801210:	eb d3                	jmp    8011e5 <write+0x59>

00801212 <seek>:

int
seek(int fdnum, off_t offset)
{
  801212:	f3 0f 1e fb          	endbr32 
  801216:	55                   	push   %ebp
  801217:	89 e5                	mov    %esp,%ebp
  801219:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80121c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80121f:	50                   	push   %eax
  801220:	ff 75 08             	pushl  0x8(%ebp)
  801223:	e8 0b fc ff ff       	call   800e33 <fd_lookup>
  801228:	83 c4 10             	add    $0x10,%esp
  80122b:	85 c0                	test   %eax,%eax
  80122d:	78 0e                	js     80123d <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  80122f:	8b 55 0c             	mov    0xc(%ebp),%edx
  801232:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801235:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801238:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80123d:	c9                   	leave  
  80123e:	c3                   	ret    

0080123f <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  80123f:	f3 0f 1e fb          	endbr32 
  801243:	55                   	push   %ebp
  801244:	89 e5                	mov    %esp,%ebp
  801246:	53                   	push   %ebx
  801247:	83 ec 1c             	sub    $0x1c,%esp
  80124a:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  80124d:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801250:	50                   	push   %eax
  801251:	53                   	push   %ebx
  801252:	e8 dc fb ff ff       	call   800e33 <fd_lookup>
  801257:	83 c4 10             	add    $0x10,%esp
  80125a:	85 c0                	test   %eax,%eax
  80125c:	78 37                	js     801295 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80125e:	83 ec 08             	sub    $0x8,%esp
  801261:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801264:	50                   	push   %eax
  801265:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801268:	ff 30                	pushl  (%eax)
  80126a:	e8 18 fc ff ff       	call   800e87 <dev_lookup>
  80126f:	83 c4 10             	add    $0x10,%esp
  801272:	85 c0                	test   %eax,%eax
  801274:	78 1f                	js     801295 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  801276:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801279:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  80127d:	74 1b                	je     80129a <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  80127f:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801282:	8b 52 18             	mov    0x18(%edx),%edx
  801285:	85 d2                	test   %edx,%edx
  801287:	74 32                	je     8012bb <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  801289:	83 ec 08             	sub    $0x8,%esp
  80128c:	ff 75 0c             	pushl  0xc(%ebp)
  80128f:	50                   	push   %eax
  801290:	ff d2                	call   *%edx
  801292:	83 c4 10             	add    $0x10,%esp
}
  801295:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801298:	c9                   	leave  
  801299:	c3                   	ret    
			thisenv->env_id, fdnum);
  80129a:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  80129f:	8b 40 48             	mov    0x48(%eax),%eax
  8012a2:	83 ec 04             	sub    $0x4,%esp
  8012a5:	53                   	push   %ebx
  8012a6:	50                   	push   %eax
  8012a7:	68 8c 22 80 00       	push   $0x80228c
  8012ac:	e8 d1 ee ff ff       	call   800182 <cprintf>
		return -E_INVAL;
  8012b1:	83 c4 10             	add    $0x10,%esp
  8012b4:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8012b9:	eb da                	jmp    801295 <ftruncate+0x56>
		return -E_NOT_SUPP;
  8012bb:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8012c0:	eb d3                	jmp    801295 <ftruncate+0x56>

008012c2 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8012c2:	f3 0f 1e fb          	endbr32 
  8012c6:	55                   	push   %ebp
  8012c7:	89 e5                	mov    %esp,%ebp
  8012c9:	53                   	push   %ebx
  8012ca:	83 ec 1c             	sub    $0x1c,%esp
  8012cd:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012d0:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012d3:	50                   	push   %eax
  8012d4:	ff 75 08             	pushl  0x8(%ebp)
  8012d7:	e8 57 fb ff ff       	call   800e33 <fd_lookup>
  8012dc:	83 c4 10             	add    $0x10,%esp
  8012df:	85 c0                	test   %eax,%eax
  8012e1:	78 4b                	js     80132e <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8012e3:	83 ec 08             	sub    $0x8,%esp
  8012e6:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012e9:	50                   	push   %eax
  8012ea:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012ed:	ff 30                	pushl  (%eax)
  8012ef:	e8 93 fb ff ff       	call   800e87 <dev_lookup>
  8012f4:	83 c4 10             	add    $0x10,%esp
  8012f7:	85 c0                	test   %eax,%eax
  8012f9:	78 33                	js     80132e <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  8012fb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8012fe:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  801302:	74 2f                	je     801333 <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  801304:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  801307:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  80130e:	00 00 00 
	stat->st_isdir = 0;
  801311:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801318:	00 00 00 
	stat->st_dev = dev;
  80131b:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  801321:	83 ec 08             	sub    $0x8,%esp
  801324:	53                   	push   %ebx
  801325:	ff 75 f0             	pushl  -0x10(%ebp)
  801328:	ff 50 14             	call   *0x14(%eax)
  80132b:	83 c4 10             	add    $0x10,%esp
}
  80132e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801331:	c9                   	leave  
  801332:	c3                   	ret    
		return -E_NOT_SUPP;
  801333:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801338:	eb f4                	jmp    80132e <fstat+0x6c>

0080133a <stat>:

int
stat(const char *path, struct Stat *stat)
{
  80133a:	f3 0f 1e fb          	endbr32 
  80133e:	55                   	push   %ebp
  80133f:	89 e5                	mov    %esp,%ebp
  801341:	56                   	push   %esi
  801342:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  801343:	83 ec 08             	sub    $0x8,%esp
  801346:	6a 00                	push   $0x0
  801348:	ff 75 08             	pushl  0x8(%ebp)
  80134b:	e8 fb 01 00 00       	call   80154b <open>
  801350:	89 c3                	mov    %eax,%ebx
  801352:	83 c4 10             	add    $0x10,%esp
  801355:	85 c0                	test   %eax,%eax
  801357:	78 1b                	js     801374 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  801359:	83 ec 08             	sub    $0x8,%esp
  80135c:	ff 75 0c             	pushl  0xc(%ebp)
  80135f:	50                   	push   %eax
  801360:	e8 5d ff ff ff       	call   8012c2 <fstat>
  801365:	89 c6                	mov    %eax,%esi
	close(fd);
  801367:	89 1c 24             	mov    %ebx,(%esp)
  80136a:	e8 fd fb ff ff       	call   800f6c <close>
	return r;
  80136f:	83 c4 10             	add    $0x10,%esp
  801372:	89 f3                	mov    %esi,%ebx
}
  801374:	89 d8                	mov    %ebx,%eax
  801376:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801379:	5b                   	pop    %ebx
  80137a:	5e                   	pop    %esi
  80137b:	5d                   	pop    %ebp
  80137c:	c3                   	ret    

0080137d <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  80137d:	55                   	push   %ebp
  80137e:	89 e5                	mov    %esp,%ebp
  801380:	56                   	push   %esi
  801381:	53                   	push   %ebx
  801382:	89 c6                	mov    %eax,%esi
  801384:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  801386:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  80138d:	74 27                	je     8013b6 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  80138f:	6a 07                	push   $0x7
  801391:	68 00 50 80 00       	push   $0x805000
  801396:	56                   	push   %esi
  801397:	ff 35 00 40 80 00    	pushl  0x804000
  80139d:	e8 1c 08 00 00       	call   801bbe <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  8013a2:	83 c4 0c             	add    $0xc,%esp
  8013a5:	6a 00                	push   $0x0
  8013a7:	53                   	push   %ebx
  8013a8:	6a 00                	push   $0x0
  8013aa:	e8 8e 07 00 00       	call   801b3d <ipc_recv>
}
  8013af:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8013b2:	5b                   	pop    %ebx
  8013b3:	5e                   	pop    %esi
  8013b4:	5d                   	pop    %ebp
  8013b5:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8013b6:	83 ec 0c             	sub    $0xc,%esp
  8013b9:	6a 01                	push   $0x1
  8013bb:	e8 56 08 00 00       	call   801c16 <ipc_find_env>
  8013c0:	a3 00 40 80 00       	mov    %eax,0x804000
  8013c5:	83 c4 10             	add    $0x10,%esp
  8013c8:	eb c5                	jmp    80138f <fsipc+0x12>

008013ca <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8013ca:	f3 0f 1e fb          	endbr32 
  8013ce:	55                   	push   %ebp
  8013cf:	89 e5                	mov    %esp,%ebp
  8013d1:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8013d4:	8b 45 08             	mov    0x8(%ebp),%eax
  8013d7:	8b 40 0c             	mov    0xc(%eax),%eax
  8013da:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  8013df:	8b 45 0c             	mov    0xc(%ebp),%eax
  8013e2:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  8013e7:	ba 00 00 00 00       	mov    $0x0,%edx
  8013ec:	b8 02 00 00 00       	mov    $0x2,%eax
  8013f1:	e8 87 ff ff ff       	call   80137d <fsipc>
}
  8013f6:	c9                   	leave  
  8013f7:	c3                   	ret    

008013f8 <devfile_flush>:
{
  8013f8:	f3 0f 1e fb          	endbr32 
  8013fc:	55                   	push   %ebp
  8013fd:	89 e5                	mov    %esp,%ebp
  8013ff:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  801402:	8b 45 08             	mov    0x8(%ebp),%eax
  801405:	8b 40 0c             	mov    0xc(%eax),%eax
  801408:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  80140d:	ba 00 00 00 00       	mov    $0x0,%edx
  801412:	b8 06 00 00 00       	mov    $0x6,%eax
  801417:	e8 61 ff ff ff       	call   80137d <fsipc>
}
  80141c:	c9                   	leave  
  80141d:	c3                   	ret    

0080141e <devfile_stat>:
{
  80141e:	f3 0f 1e fb          	endbr32 
  801422:	55                   	push   %ebp
  801423:	89 e5                	mov    %esp,%ebp
  801425:	53                   	push   %ebx
  801426:	83 ec 04             	sub    $0x4,%esp
  801429:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  80142c:	8b 45 08             	mov    0x8(%ebp),%eax
  80142f:	8b 40 0c             	mov    0xc(%eax),%eax
  801432:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801437:	ba 00 00 00 00       	mov    $0x0,%edx
  80143c:	b8 05 00 00 00       	mov    $0x5,%eax
  801441:	e8 37 ff ff ff       	call   80137d <fsipc>
  801446:	85 c0                	test   %eax,%eax
  801448:	78 2c                	js     801476 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  80144a:	83 ec 08             	sub    $0x8,%esp
  80144d:	68 00 50 80 00       	push   $0x805000
  801452:	53                   	push   %ebx
  801453:	e8 03 f3 ff ff       	call   80075b <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  801458:	a1 80 50 80 00       	mov    0x805080,%eax
  80145d:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  801463:	a1 84 50 80 00       	mov    0x805084,%eax
  801468:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  80146e:	83 c4 10             	add    $0x10,%esp
  801471:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801476:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801479:	c9                   	leave  
  80147a:	c3                   	ret    

0080147b <devfile_write>:
{
  80147b:	f3 0f 1e fb          	endbr32 
  80147f:	55                   	push   %ebp
  801480:	89 e5                	mov    %esp,%ebp
  801482:	83 ec 0c             	sub    $0xc,%esp
  801485:	8b 45 10             	mov    0x10(%ebp),%eax
  801488:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  80148d:	ba f8 0f 00 00       	mov    $0xff8,%edx
  801492:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  801495:	8b 55 08             	mov    0x8(%ebp),%edx
  801498:	8b 52 0c             	mov    0xc(%edx),%edx
  80149b:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  8014a1:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  8014a6:	50                   	push   %eax
  8014a7:	ff 75 0c             	pushl  0xc(%ebp)
  8014aa:	68 08 50 80 00       	push   $0x805008
  8014af:	e8 5d f4 ff ff       	call   800911 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8014b4:	ba 00 00 00 00       	mov    $0x0,%edx
  8014b9:	b8 04 00 00 00       	mov    $0x4,%eax
  8014be:	e8 ba fe ff ff       	call   80137d <fsipc>
  8014c3:	c9                   	leave  
  8014c4:	c3                   	ret    

008014c5 <devfile_read>:
{
  8014c5:	f3 0f 1e fb          	endbr32 
  8014c9:	55                   	push   %ebp
  8014ca:	89 e5                	mov    %esp,%ebp
  8014cc:	56                   	push   %esi
  8014cd:	53                   	push   %ebx
  8014ce:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  8014d1:	8b 45 08             	mov    0x8(%ebp),%eax
  8014d4:	8b 40 0c             	mov    0xc(%eax),%eax
  8014d7:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  8014dc:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  8014e2:	ba 00 00 00 00       	mov    $0x0,%edx
  8014e7:	b8 03 00 00 00       	mov    $0x3,%eax
  8014ec:	e8 8c fe ff ff       	call   80137d <fsipc>
  8014f1:	89 c3                	mov    %eax,%ebx
  8014f3:	85 c0                	test   %eax,%eax
  8014f5:	78 1f                	js     801516 <devfile_read+0x51>
	assert(r <= n);
  8014f7:	39 f0                	cmp    %esi,%eax
  8014f9:	77 24                	ja     80151f <devfile_read+0x5a>
	assert(r <= PGSIZE);
  8014fb:	3d 00 10 00 00       	cmp    $0x1000,%eax
  801500:	7f 33                	jg     801535 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  801502:	83 ec 04             	sub    $0x4,%esp
  801505:	50                   	push   %eax
  801506:	68 00 50 80 00       	push   $0x805000
  80150b:	ff 75 0c             	pushl  0xc(%ebp)
  80150e:	e8 fe f3 ff ff       	call   800911 <memmove>
	return r;
  801513:	83 c4 10             	add    $0x10,%esp
}
  801516:	89 d8                	mov    %ebx,%eax
  801518:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80151b:	5b                   	pop    %ebx
  80151c:	5e                   	pop    %esi
  80151d:	5d                   	pop    %ebp
  80151e:	c3                   	ret    
	assert(r <= n);
  80151f:	68 f8 22 80 00       	push   $0x8022f8
  801524:	68 ff 22 80 00       	push   $0x8022ff
  801529:	6a 7c                	push   $0x7c
  80152b:	68 14 23 80 00       	push   $0x802314
  801530:	e8 be 05 00 00       	call   801af3 <_panic>
	assert(r <= PGSIZE);
  801535:	68 1f 23 80 00       	push   $0x80231f
  80153a:	68 ff 22 80 00       	push   $0x8022ff
  80153f:	6a 7d                	push   $0x7d
  801541:	68 14 23 80 00       	push   $0x802314
  801546:	e8 a8 05 00 00       	call   801af3 <_panic>

0080154b <open>:
{
  80154b:	f3 0f 1e fb          	endbr32 
  80154f:	55                   	push   %ebp
  801550:	89 e5                	mov    %esp,%ebp
  801552:	56                   	push   %esi
  801553:	53                   	push   %ebx
  801554:	83 ec 1c             	sub    $0x1c,%esp
  801557:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  80155a:	56                   	push   %esi
  80155b:	e8 b8 f1 ff ff       	call   800718 <strlen>
  801560:	83 c4 10             	add    $0x10,%esp
  801563:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  801568:	7f 6c                	jg     8015d6 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  80156a:	83 ec 0c             	sub    $0xc,%esp
  80156d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801570:	50                   	push   %eax
  801571:	e8 67 f8 ff ff       	call   800ddd <fd_alloc>
  801576:	89 c3                	mov    %eax,%ebx
  801578:	83 c4 10             	add    $0x10,%esp
  80157b:	85 c0                	test   %eax,%eax
  80157d:	78 3c                	js     8015bb <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  80157f:	83 ec 08             	sub    $0x8,%esp
  801582:	56                   	push   %esi
  801583:	68 00 50 80 00       	push   $0x805000
  801588:	e8 ce f1 ff ff       	call   80075b <strcpy>
	fsipcbuf.open.req_omode = mode;
  80158d:	8b 45 0c             	mov    0xc(%ebp),%eax
  801590:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  801595:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801598:	b8 01 00 00 00       	mov    $0x1,%eax
  80159d:	e8 db fd ff ff       	call   80137d <fsipc>
  8015a2:	89 c3                	mov    %eax,%ebx
  8015a4:	83 c4 10             	add    $0x10,%esp
  8015a7:	85 c0                	test   %eax,%eax
  8015a9:	78 19                	js     8015c4 <open+0x79>
	return fd2num(fd);
  8015ab:	83 ec 0c             	sub    $0xc,%esp
  8015ae:	ff 75 f4             	pushl  -0xc(%ebp)
  8015b1:	e8 f8 f7 ff ff       	call   800dae <fd2num>
  8015b6:	89 c3                	mov    %eax,%ebx
  8015b8:	83 c4 10             	add    $0x10,%esp
}
  8015bb:	89 d8                	mov    %ebx,%eax
  8015bd:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8015c0:	5b                   	pop    %ebx
  8015c1:	5e                   	pop    %esi
  8015c2:	5d                   	pop    %ebp
  8015c3:	c3                   	ret    
		fd_close(fd, 0);
  8015c4:	83 ec 08             	sub    $0x8,%esp
  8015c7:	6a 00                	push   $0x0
  8015c9:	ff 75 f4             	pushl  -0xc(%ebp)
  8015cc:	e8 10 f9 ff ff       	call   800ee1 <fd_close>
		return r;
  8015d1:	83 c4 10             	add    $0x10,%esp
  8015d4:	eb e5                	jmp    8015bb <open+0x70>
		return -E_BAD_PATH;
  8015d6:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  8015db:	eb de                	jmp    8015bb <open+0x70>

008015dd <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  8015dd:	f3 0f 1e fb          	endbr32 
  8015e1:	55                   	push   %ebp
  8015e2:	89 e5                	mov    %esp,%ebp
  8015e4:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  8015e7:	ba 00 00 00 00       	mov    $0x0,%edx
  8015ec:	b8 08 00 00 00       	mov    $0x8,%eax
  8015f1:	e8 87 fd ff ff       	call   80137d <fsipc>
}
  8015f6:	c9                   	leave  
  8015f7:	c3                   	ret    

008015f8 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  8015f8:	f3 0f 1e fb          	endbr32 
  8015fc:	55                   	push   %ebp
  8015fd:	89 e5                	mov    %esp,%ebp
  8015ff:	56                   	push   %esi
  801600:	53                   	push   %ebx
  801601:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  801604:	83 ec 0c             	sub    $0xc,%esp
  801607:	ff 75 08             	pushl  0x8(%ebp)
  80160a:	e8 b3 f7 ff ff       	call   800dc2 <fd2data>
  80160f:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801611:	83 c4 08             	add    $0x8,%esp
  801614:	68 2b 23 80 00       	push   $0x80232b
  801619:	53                   	push   %ebx
  80161a:	e8 3c f1 ff ff       	call   80075b <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  80161f:	8b 46 04             	mov    0x4(%esi),%eax
  801622:	2b 06                	sub    (%esi),%eax
  801624:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  80162a:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801631:	00 00 00 
	stat->st_dev = &devpipe;
  801634:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  80163b:	30 80 00 
	return 0;
}
  80163e:	b8 00 00 00 00       	mov    $0x0,%eax
  801643:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801646:	5b                   	pop    %ebx
  801647:	5e                   	pop    %esi
  801648:	5d                   	pop    %ebp
  801649:	c3                   	ret    

0080164a <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  80164a:	f3 0f 1e fb          	endbr32 
  80164e:	55                   	push   %ebp
  80164f:	89 e5                	mov    %esp,%ebp
  801651:	53                   	push   %ebx
  801652:	83 ec 0c             	sub    $0xc,%esp
  801655:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801658:	53                   	push   %ebx
  801659:	6a 00                	push   $0x0
  80165b:	e8 ca f5 ff ff       	call   800c2a <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  801660:	89 1c 24             	mov    %ebx,(%esp)
  801663:	e8 5a f7 ff ff       	call   800dc2 <fd2data>
  801668:	83 c4 08             	add    $0x8,%esp
  80166b:	50                   	push   %eax
  80166c:	6a 00                	push   $0x0
  80166e:	e8 b7 f5 ff ff       	call   800c2a <sys_page_unmap>
}
  801673:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801676:	c9                   	leave  
  801677:	c3                   	ret    

00801678 <_pipeisclosed>:
{
  801678:	55                   	push   %ebp
  801679:	89 e5                	mov    %esp,%ebp
  80167b:	57                   	push   %edi
  80167c:	56                   	push   %esi
  80167d:	53                   	push   %ebx
  80167e:	83 ec 1c             	sub    $0x1c,%esp
  801681:	89 c7                	mov    %eax,%edi
  801683:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  801685:	a1 04 40 80 00       	mov    0x804004,%eax
  80168a:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  80168d:	83 ec 0c             	sub    $0xc,%esp
  801690:	57                   	push   %edi
  801691:	e8 bd 05 00 00       	call   801c53 <pageref>
  801696:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801699:	89 34 24             	mov    %esi,(%esp)
  80169c:	e8 b2 05 00 00       	call   801c53 <pageref>
		nn = thisenv->env_runs;
  8016a1:	8b 15 04 40 80 00    	mov    0x804004,%edx
  8016a7:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  8016aa:	83 c4 10             	add    $0x10,%esp
  8016ad:	39 cb                	cmp    %ecx,%ebx
  8016af:	74 1b                	je     8016cc <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  8016b1:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016b4:	75 cf                	jne    801685 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  8016b6:	8b 42 58             	mov    0x58(%edx),%eax
  8016b9:	6a 01                	push   $0x1
  8016bb:	50                   	push   %eax
  8016bc:	53                   	push   %ebx
  8016bd:	68 32 23 80 00       	push   $0x802332
  8016c2:	e8 bb ea ff ff       	call   800182 <cprintf>
  8016c7:	83 c4 10             	add    $0x10,%esp
  8016ca:	eb b9                	jmp    801685 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  8016cc:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016cf:	0f 94 c0             	sete   %al
  8016d2:	0f b6 c0             	movzbl %al,%eax
}
  8016d5:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8016d8:	5b                   	pop    %ebx
  8016d9:	5e                   	pop    %esi
  8016da:	5f                   	pop    %edi
  8016db:	5d                   	pop    %ebp
  8016dc:	c3                   	ret    

008016dd <devpipe_write>:
{
  8016dd:	f3 0f 1e fb          	endbr32 
  8016e1:	55                   	push   %ebp
  8016e2:	89 e5                	mov    %esp,%ebp
  8016e4:	57                   	push   %edi
  8016e5:	56                   	push   %esi
  8016e6:	53                   	push   %ebx
  8016e7:	83 ec 28             	sub    $0x28,%esp
  8016ea:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  8016ed:	56                   	push   %esi
  8016ee:	e8 cf f6 ff ff       	call   800dc2 <fd2data>
  8016f3:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8016f5:	83 c4 10             	add    $0x10,%esp
  8016f8:	bf 00 00 00 00       	mov    $0x0,%edi
  8016fd:	3b 7d 10             	cmp    0x10(%ebp),%edi
  801700:	74 4f                	je     801751 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  801702:	8b 43 04             	mov    0x4(%ebx),%eax
  801705:	8b 0b                	mov    (%ebx),%ecx
  801707:	8d 51 20             	lea    0x20(%ecx),%edx
  80170a:	39 d0                	cmp    %edx,%eax
  80170c:	72 14                	jb     801722 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  80170e:	89 da                	mov    %ebx,%edx
  801710:	89 f0                	mov    %esi,%eax
  801712:	e8 61 ff ff ff       	call   801678 <_pipeisclosed>
  801717:	85 c0                	test   %eax,%eax
  801719:	75 3b                	jne    801756 <devpipe_write+0x79>
			sys_yield();
  80171b:	e8 5a f4 ff ff       	call   800b7a <sys_yield>
  801720:	eb e0                	jmp    801702 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  801722:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801725:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801729:	88 4d e7             	mov    %cl,-0x19(%ebp)
  80172c:	89 c2                	mov    %eax,%edx
  80172e:	c1 fa 1f             	sar    $0x1f,%edx
  801731:	89 d1                	mov    %edx,%ecx
  801733:	c1 e9 1b             	shr    $0x1b,%ecx
  801736:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801739:	83 e2 1f             	and    $0x1f,%edx
  80173c:	29 ca                	sub    %ecx,%edx
  80173e:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  801742:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801746:	83 c0 01             	add    $0x1,%eax
  801749:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  80174c:	83 c7 01             	add    $0x1,%edi
  80174f:	eb ac                	jmp    8016fd <devpipe_write+0x20>
	return i;
  801751:	8b 45 10             	mov    0x10(%ebp),%eax
  801754:	eb 05                	jmp    80175b <devpipe_write+0x7e>
				return 0;
  801756:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80175b:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80175e:	5b                   	pop    %ebx
  80175f:	5e                   	pop    %esi
  801760:	5f                   	pop    %edi
  801761:	5d                   	pop    %ebp
  801762:	c3                   	ret    

00801763 <devpipe_read>:
{
  801763:	f3 0f 1e fb          	endbr32 
  801767:	55                   	push   %ebp
  801768:	89 e5                	mov    %esp,%ebp
  80176a:	57                   	push   %edi
  80176b:	56                   	push   %esi
  80176c:	53                   	push   %ebx
  80176d:	83 ec 18             	sub    $0x18,%esp
  801770:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  801773:	57                   	push   %edi
  801774:	e8 49 f6 ff ff       	call   800dc2 <fd2data>
  801779:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  80177b:	83 c4 10             	add    $0x10,%esp
  80177e:	be 00 00 00 00       	mov    $0x0,%esi
  801783:	3b 75 10             	cmp    0x10(%ebp),%esi
  801786:	75 14                	jne    80179c <devpipe_read+0x39>
	return i;
  801788:	8b 45 10             	mov    0x10(%ebp),%eax
  80178b:	eb 02                	jmp    80178f <devpipe_read+0x2c>
				return i;
  80178d:	89 f0                	mov    %esi,%eax
}
  80178f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801792:	5b                   	pop    %ebx
  801793:	5e                   	pop    %esi
  801794:	5f                   	pop    %edi
  801795:	5d                   	pop    %ebp
  801796:	c3                   	ret    
			sys_yield();
  801797:	e8 de f3 ff ff       	call   800b7a <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  80179c:	8b 03                	mov    (%ebx),%eax
  80179e:	3b 43 04             	cmp    0x4(%ebx),%eax
  8017a1:	75 18                	jne    8017bb <devpipe_read+0x58>
			if (i > 0)
  8017a3:	85 f6                	test   %esi,%esi
  8017a5:	75 e6                	jne    80178d <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  8017a7:	89 da                	mov    %ebx,%edx
  8017a9:	89 f8                	mov    %edi,%eax
  8017ab:	e8 c8 fe ff ff       	call   801678 <_pipeisclosed>
  8017b0:	85 c0                	test   %eax,%eax
  8017b2:	74 e3                	je     801797 <devpipe_read+0x34>
				return 0;
  8017b4:	b8 00 00 00 00       	mov    $0x0,%eax
  8017b9:	eb d4                	jmp    80178f <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  8017bb:	99                   	cltd   
  8017bc:	c1 ea 1b             	shr    $0x1b,%edx
  8017bf:	01 d0                	add    %edx,%eax
  8017c1:	83 e0 1f             	and    $0x1f,%eax
  8017c4:	29 d0                	sub    %edx,%eax
  8017c6:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  8017cb:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8017ce:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  8017d1:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  8017d4:	83 c6 01             	add    $0x1,%esi
  8017d7:	eb aa                	jmp    801783 <devpipe_read+0x20>

008017d9 <pipe>:
{
  8017d9:	f3 0f 1e fb          	endbr32 
  8017dd:	55                   	push   %ebp
  8017de:	89 e5                	mov    %esp,%ebp
  8017e0:	56                   	push   %esi
  8017e1:	53                   	push   %ebx
  8017e2:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  8017e5:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8017e8:	50                   	push   %eax
  8017e9:	e8 ef f5 ff ff       	call   800ddd <fd_alloc>
  8017ee:	89 c3                	mov    %eax,%ebx
  8017f0:	83 c4 10             	add    $0x10,%esp
  8017f3:	85 c0                	test   %eax,%eax
  8017f5:	0f 88 23 01 00 00    	js     80191e <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8017fb:	83 ec 04             	sub    $0x4,%esp
  8017fe:	68 07 04 00 00       	push   $0x407
  801803:	ff 75 f4             	pushl  -0xc(%ebp)
  801806:	6a 00                	push   $0x0
  801808:	e8 90 f3 ff ff       	call   800b9d <sys_page_alloc>
  80180d:	89 c3                	mov    %eax,%ebx
  80180f:	83 c4 10             	add    $0x10,%esp
  801812:	85 c0                	test   %eax,%eax
  801814:	0f 88 04 01 00 00    	js     80191e <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  80181a:	83 ec 0c             	sub    $0xc,%esp
  80181d:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801820:	50                   	push   %eax
  801821:	e8 b7 f5 ff ff       	call   800ddd <fd_alloc>
  801826:	89 c3                	mov    %eax,%ebx
  801828:	83 c4 10             	add    $0x10,%esp
  80182b:	85 c0                	test   %eax,%eax
  80182d:	0f 88 db 00 00 00    	js     80190e <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801833:	83 ec 04             	sub    $0x4,%esp
  801836:	68 07 04 00 00       	push   $0x407
  80183b:	ff 75 f0             	pushl  -0x10(%ebp)
  80183e:	6a 00                	push   $0x0
  801840:	e8 58 f3 ff ff       	call   800b9d <sys_page_alloc>
  801845:	89 c3                	mov    %eax,%ebx
  801847:	83 c4 10             	add    $0x10,%esp
  80184a:	85 c0                	test   %eax,%eax
  80184c:	0f 88 bc 00 00 00    	js     80190e <pipe+0x135>
	va = fd2data(fd0);
  801852:	83 ec 0c             	sub    $0xc,%esp
  801855:	ff 75 f4             	pushl  -0xc(%ebp)
  801858:	e8 65 f5 ff ff       	call   800dc2 <fd2data>
  80185d:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80185f:	83 c4 0c             	add    $0xc,%esp
  801862:	68 07 04 00 00       	push   $0x407
  801867:	50                   	push   %eax
  801868:	6a 00                	push   $0x0
  80186a:	e8 2e f3 ff ff       	call   800b9d <sys_page_alloc>
  80186f:	89 c3                	mov    %eax,%ebx
  801871:	83 c4 10             	add    $0x10,%esp
  801874:	85 c0                	test   %eax,%eax
  801876:	0f 88 82 00 00 00    	js     8018fe <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80187c:	83 ec 0c             	sub    $0xc,%esp
  80187f:	ff 75 f0             	pushl  -0x10(%ebp)
  801882:	e8 3b f5 ff ff       	call   800dc2 <fd2data>
  801887:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  80188e:	50                   	push   %eax
  80188f:	6a 00                	push   $0x0
  801891:	56                   	push   %esi
  801892:	6a 00                	push   $0x0
  801894:	e8 4b f3 ff ff       	call   800be4 <sys_page_map>
  801899:	89 c3                	mov    %eax,%ebx
  80189b:	83 c4 20             	add    $0x20,%esp
  80189e:	85 c0                	test   %eax,%eax
  8018a0:	78 4e                	js     8018f0 <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  8018a2:	a1 20 30 80 00       	mov    0x803020,%eax
  8018a7:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8018aa:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  8018ac:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8018af:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  8018b6:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8018b9:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  8018bb:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8018be:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  8018c5:	83 ec 0c             	sub    $0xc,%esp
  8018c8:	ff 75 f4             	pushl  -0xc(%ebp)
  8018cb:	e8 de f4 ff ff       	call   800dae <fd2num>
  8018d0:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018d3:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  8018d5:	83 c4 04             	add    $0x4,%esp
  8018d8:	ff 75 f0             	pushl  -0x10(%ebp)
  8018db:	e8 ce f4 ff ff       	call   800dae <fd2num>
  8018e0:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018e3:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  8018e6:	83 c4 10             	add    $0x10,%esp
  8018e9:	bb 00 00 00 00       	mov    $0x0,%ebx
  8018ee:	eb 2e                	jmp    80191e <pipe+0x145>
	sys_page_unmap(0, va);
  8018f0:	83 ec 08             	sub    $0x8,%esp
  8018f3:	56                   	push   %esi
  8018f4:	6a 00                	push   $0x0
  8018f6:	e8 2f f3 ff ff       	call   800c2a <sys_page_unmap>
  8018fb:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  8018fe:	83 ec 08             	sub    $0x8,%esp
  801901:	ff 75 f0             	pushl  -0x10(%ebp)
  801904:	6a 00                	push   $0x0
  801906:	e8 1f f3 ff ff       	call   800c2a <sys_page_unmap>
  80190b:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  80190e:	83 ec 08             	sub    $0x8,%esp
  801911:	ff 75 f4             	pushl  -0xc(%ebp)
  801914:	6a 00                	push   $0x0
  801916:	e8 0f f3 ff ff       	call   800c2a <sys_page_unmap>
  80191b:	83 c4 10             	add    $0x10,%esp
}
  80191e:	89 d8                	mov    %ebx,%eax
  801920:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801923:	5b                   	pop    %ebx
  801924:	5e                   	pop    %esi
  801925:	5d                   	pop    %ebp
  801926:	c3                   	ret    

00801927 <pipeisclosed>:
{
  801927:	f3 0f 1e fb          	endbr32 
  80192b:	55                   	push   %ebp
  80192c:	89 e5                	mov    %esp,%ebp
  80192e:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801931:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801934:	50                   	push   %eax
  801935:	ff 75 08             	pushl  0x8(%ebp)
  801938:	e8 f6 f4 ff ff       	call   800e33 <fd_lookup>
  80193d:	83 c4 10             	add    $0x10,%esp
  801940:	85 c0                	test   %eax,%eax
  801942:	78 18                	js     80195c <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801944:	83 ec 0c             	sub    $0xc,%esp
  801947:	ff 75 f4             	pushl  -0xc(%ebp)
  80194a:	e8 73 f4 ff ff       	call   800dc2 <fd2data>
  80194f:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801951:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801954:	e8 1f fd ff ff       	call   801678 <_pipeisclosed>
  801959:	83 c4 10             	add    $0x10,%esp
}
  80195c:	c9                   	leave  
  80195d:	c3                   	ret    

0080195e <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  80195e:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801962:	b8 00 00 00 00       	mov    $0x0,%eax
  801967:	c3                   	ret    

00801968 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801968:	f3 0f 1e fb          	endbr32 
  80196c:	55                   	push   %ebp
  80196d:	89 e5                	mov    %esp,%ebp
  80196f:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801972:	68 4a 23 80 00       	push   $0x80234a
  801977:	ff 75 0c             	pushl  0xc(%ebp)
  80197a:	e8 dc ed ff ff       	call   80075b <strcpy>
	return 0;
}
  80197f:	b8 00 00 00 00       	mov    $0x0,%eax
  801984:	c9                   	leave  
  801985:	c3                   	ret    

00801986 <devcons_write>:
{
  801986:	f3 0f 1e fb          	endbr32 
  80198a:	55                   	push   %ebp
  80198b:	89 e5                	mov    %esp,%ebp
  80198d:	57                   	push   %edi
  80198e:	56                   	push   %esi
  80198f:	53                   	push   %ebx
  801990:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801996:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  80199b:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  8019a1:	3b 75 10             	cmp    0x10(%ebp),%esi
  8019a4:	73 31                	jae    8019d7 <devcons_write+0x51>
		m = n - tot;
  8019a6:	8b 5d 10             	mov    0x10(%ebp),%ebx
  8019a9:	29 f3                	sub    %esi,%ebx
  8019ab:	83 fb 7f             	cmp    $0x7f,%ebx
  8019ae:	b8 7f 00 00 00       	mov    $0x7f,%eax
  8019b3:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  8019b6:	83 ec 04             	sub    $0x4,%esp
  8019b9:	53                   	push   %ebx
  8019ba:	89 f0                	mov    %esi,%eax
  8019bc:	03 45 0c             	add    0xc(%ebp),%eax
  8019bf:	50                   	push   %eax
  8019c0:	57                   	push   %edi
  8019c1:	e8 4b ef ff ff       	call   800911 <memmove>
		sys_cputs(buf, m);
  8019c6:	83 c4 08             	add    $0x8,%esp
  8019c9:	53                   	push   %ebx
  8019ca:	57                   	push   %edi
  8019cb:	e8 fd f0 ff ff       	call   800acd <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  8019d0:	01 de                	add    %ebx,%esi
  8019d2:	83 c4 10             	add    $0x10,%esp
  8019d5:	eb ca                	jmp    8019a1 <devcons_write+0x1b>
}
  8019d7:	89 f0                	mov    %esi,%eax
  8019d9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8019dc:	5b                   	pop    %ebx
  8019dd:	5e                   	pop    %esi
  8019de:	5f                   	pop    %edi
  8019df:	5d                   	pop    %ebp
  8019e0:	c3                   	ret    

008019e1 <devcons_read>:
{
  8019e1:	f3 0f 1e fb          	endbr32 
  8019e5:	55                   	push   %ebp
  8019e6:	89 e5                	mov    %esp,%ebp
  8019e8:	83 ec 08             	sub    $0x8,%esp
  8019eb:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  8019f0:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8019f4:	74 21                	je     801a17 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  8019f6:	e8 f4 f0 ff ff       	call   800aef <sys_cgetc>
  8019fb:	85 c0                	test   %eax,%eax
  8019fd:	75 07                	jne    801a06 <devcons_read+0x25>
		sys_yield();
  8019ff:	e8 76 f1 ff ff       	call   800b7a <sys_yield>
  801a04:	eb f0                	jmp    8019f6 <devcons_read+0x15>
	if (c < 0)
  801a06:	78 0f                	js     801a17 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  801a08:	83 f8 04             	cmp    $0x4,%eax
  801a0b:	74 0c                	je     801a19 <devcons_read+0x38>
	*(char*)vbuf = c;
  801a0d:	8b 55 0c             	mov    0xc(%ebp),%edx
  801a10:	88 02                	mov    %al,(%edx)
	return 1;
  801a12:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801a17:	c9                   	leave  
  801a18:	c3                   	ret    
		return 0;
  801a19:	b8 00 00 00 00       	mov    $0x0,%eax
  801a1e:	eb f7                	jmp    801a17 <devcons_read+0x36>

00801a20 <cputchar>:
{
  801a20:	f3 0f 1e fb          	endbr32 
  801a24:	55                   	push   %ebp
  801a25:	89 e5                	mov    %esp,%ebp
  801a27:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801a2a:	8b 45 08             	mov    0x8(%ebp),%eax
  801a2d:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801a30:	6a 01                	push   $0x1
  801a32:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a35:	50                   	push   %eax
  801a36:	e8 92 f0 ff ff       	call   800acd <sys_cputs>
}
  801a3b:	83 c4 10             	add    $0x10,%esp
  801a3e:	c9                   	leave  
  801a3f:	c3                   	ret    

00801a40 <getchar>:
{
  801a40:	f3 0f 1e fb          	endbr32 
  801a44:	55                   	push   %ebp
  801a45:	89 e5                	mov    %esp,%ebp
  801a47:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801a4a:	6a 01                	push   $0x1
  801a4c:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a4f:	50                   	push   %eax
  801a50:	6a 00                	push   $0x0
  801a52:	e8 5f f6 ff ff       	call   8010b6 <read>
	if (r < 0)
  801a57:	83 c4 10             	add    $0x10,%esp
  801a5a:	85 c0                	test   %eax,%eax
  801a5c:	78 06                	js     801a64 <getchar+0x24>
	if (r < 1)
  801a5e:	74 06                	je     801a66 <getchar+0x26>
	return c;
  801a60:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801a64:	c9                   	leave  
  801a65:	c3                   	ret    
		return -E_EOF;
  801a66:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801a6b:	eb f7                	jmp    801a64 <getchar+0x24>

00801a6d <iscons>:
{
  801a6d:	f3 0f 1e fb          	endbr32 
  801a71:	55                   	push   %ebp
  801a72:	89 e5                	mov    %esp,%ebp
  801a74:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801a77:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a7a:	50                   	push   %eax
  801a7b:	ff 75 08             	pushl  0x8(%ebp)
  801a7e:	e8 b0 f3 ff ff       	call   800e33 <fd_lookup>
  801a83:	83 c4 10             	add    $0x10,%esp
  801a86:	85 c0                	test   %eax,%eax
  801a88:	78 11                	js     801a9b <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801a8a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801a8d:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801a93:	39 10                	cmp    %edx,(%eax)
  801a95:	0f 94 c0             	sete   %al
  801a98:	0f b6 c0             	movzbl %al,%eax
}
  801a9b:	c9                   	leave  
  801a9c:	c3                   	ret    

00801a9d <opencons>:
{
  801a9d:	f3 0f 1e fb          	endbr32 
  801aa1:	55                   	push   %ebp
  801aa2:	89 e5                	mov    %esp,%ebp
  801aa4:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801aa7:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801aaa:	50                   	push   %eax
  801aab:	e8 2d f3 ff ff       	call   800ddd <fd_alloc>
  801ab0:	83 c4 10             	add    $0x10,%esp
  801ab3:	85 c0                	test   %eax,%eax
  801ab5:	78 3a                	js     801af1 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801ab7:	83 ec 04             	sub    $0x4,%esp
  801aba:	68 07 04 00 00       	push   $0x407
  801abf:	ff 75 f4             	pushl  -0xc(%ebp)
  801ac2:	6a 00                	push   $0x0
  801ac4:	e8 d4 f0 ff ff       	call   800b9d <sys_page_alloc>
  801ac9:	83 c4 10             	add    $0x10,%esp
  801acc:	85 c0                	test   %eax,%eax
  801ace:	78 21                	js     801af1 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801ad0:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801ad3:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801ad9:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801adb:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801ade:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801ae5:	83 ec 0c             	sub    $0xc,%esp
  801ae8:	50                   	push   %eax
  801ae9:	e8 c0 f2 ff ff       	call   800dae <fd2num>
  801aee:	83 c4 10             	add    $0x10,%esp
}
  801af1:	c9                   	leave  
  801af2:	c3                   	ret    

00801af3 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  801af3:	f3 0f 1e fb          	endbr32 
  801af7:	55                   	push   %ebp
  801af8:	89 e5                	mov    %esp,%ebp
  801afa:	56                   	push   %esi
  801afb:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  801afc:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  801aff:	8b 35 00 30 80 00    	mov    0x803000,%esi
  801b05:	e8 4d f0 ff ff       	call   800b57 <sys_getenvid>
  801b0a:	83 ec 0c             	sub    $0xc,%esp
  801b0d:	ff 75 0c             	pushl  0xc(%ebp)
  801b10:	ff 75 08             	pushl  0x8(%ebp)
  801b13:	56                   	push   %esi
  801b14:	50                   	push   %eax
  801b15:	68 58 23 80 00       	push   $0x802358
  801b1a:	e8 63 e6 ff ff       	call   800182 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  801b1f:	83 c4 18             	add    $0x18,%esp
  801b22:	53                   	push   %ebx
  801b23:	ff 75 10             	pushl  0x10(%ebp)
  801b26:	e8 02 e6 ff ff       	call   80012d <vcprintf>
	cprintf("\n");
  801b2b:	c7 04 24 43 23 80 00 	movl   $0x802343,(%esp)
  801b32:	e8 4b e6 ff ff       	call   800182 <cprintf>
  801b37:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  801b3a:	cc                   	int3   
  801b3b:	eb fd                	jmp    801b3a <_panic+0x47>

00801b3d <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801b3d:	f3 0f 1e fb          	endbr32 
  801b41:	55                   	push   %ebp
  801b42:	89 e5                	mov    %esp,%ebp
  801b44:	56                   	push   %esi
  801b45:	53                   	push   %ebx
  801b46:	8b 75 08             	mov    0x8(%ebp),%esi
  801b49:	8b 45 0c             	mov    0xc(%ebp),%eax
  801b4c:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801b4f:	85 c0                	test   %eax,%eax
  801b51:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801b56:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801b59:	83 ec 0c             	sub    $0xc,%esp
  801b5c:	50                   	push   %eax
  801b5d:	e8 07 f2 ff ff       	call   800d69 <sys_ipc_recv>
  801b62:	83 c4 10             	add    $0x10,%esp
  801b65:	85 c0                	test   %eax,%eax
  801b67:	78 3f                	js     801ba8 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801b69:	e8 e9 ef ff ff       	call   800b57 <sys_getenvid>
  801b6e:	25 ff 03 00 00       	and    $0x3ff,%eax
  801b73:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801b76:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801b7c:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801b82:	85 f6                	test   %esi,%esi
  801b84:	74 05                	je     801b8b <ipc_recv+0x4e>
  801b86:	8b 42 74             	mov    0x74(%edx),%eax
  801b89:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801b8b:	85 db                	test   %ebx,%ebx
  801b8d:	74 0a                	je     801b99 <ipc_recv+0x5c>
  801b8f:	a1 04 40 80 00       	mov    0x804004,%eax
  801b94:	8b 40 78             	mov    0x78(%eax),%eax
  801b97:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801b99:	a1 04 40 80 00       	mov    0x804004,%eax
  801b9e:	8b 40 70             	mov    0x70(%eax),%eax
}
  801ba1:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801ba4:	5b                   	pop    %ebx
  801ba5:	5e                   	pop    %esi
  801ba6:	5d                   	pop    %ebp
  801ba7:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801ba8:	85 f6                	test   %esi,%esi
  801baa:	74 06                	je     801bb2 <ipc_recv+0x75>
  801bac:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801bb2:	85 db                	test   %ebx,%ebx
  801bb4:	74 eb                	je     801ba1 <ipc_recv+0x64>
  801bb6:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801bbc:	eb e3                	jmp    801ba1 <ipc_recv+0x64>

00801bbe <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801bbe:	f3 0f 1e fb          	endbr32 
  801bc2:	55                   	push   %ebp
  801bc3:	89 e5                	mov    %esp,%ebp
  801bc5:	57                   	push   %edi
  801bc6:	56                   	push   %esi
  801bc7:	53                   	push   %ebx
  801bc8:	83 ec 0c             	sub    $0xc,%esp
  801bcb:	8b 7d 08             	mov    0x8(%ebp),%edi
  801bce:	8b 75 0c             	mov    0xc(%ebp),%esi
  801bd1:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801bd4:	85 db                	test   %ebx,%ebx
  801bd6:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801bdb:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801bde:	ff 75 14             	pushl  0x14(%ebp)
  801be1:	53                   	push   %ebx
  801be2:	56                   	push   %esi
  801be3:	57                   	push   %edi
  801be4:	e8 59 f1 ff ff       	call   800d42 <sys_ipc_try_send>
  801be9:	83 c4 10             	add    $0x10,%esp
  801bec:	85 c0                	test   %eax,%eax
  801bee:	79 1e                	jns    801c0e <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801bf0:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801bf3:	75 07                	jne    801bfc <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801bf5:	e8 80 ef ff ff       	call   800b7a <sys_yield>
  801bfa:	eb e2                	jmp    801bde <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801bfc:	50                   	push   %eax
  801bfd:	68 7b 23 80 00       	push   $0x80237b
  801c02:	6a 3b                	push   $0x3b
  801c04:	68 8f 23 80 00       	push   $0x80238f
  801c09:	e8 e5 fe ff ff       	call   801af3 <_panic>
	}
}
  801c0e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c11:	5b                   	pop    %ebx
  801c12:	5e                   	pop    %esi
  801c13:	5f                   	pop    %edi
  801c14:	5d                   	pop    %ebp
  801c15:	c3                   	ret    

00801c16 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801c16:	f3 0f 1e fb          	endbr32 
  801c1a:	55                   	push   %ebp
  801c1b:	89 e5                	mov    %esp,%ebp
  801c1d:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801c20:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801c25:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801c28:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801c2e:	8b 52 50             	mov    0x50(%edx),%edx
  801c31:	39 ca                	cmp    %ecx,%edx
  801c33:	74 11                	je     801c46 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801c35:	83 c0 01             	add    $0x1,%eax
  801c38:	3d 00 04 00 00       	cmp    $0x400,%eax
  801c3d:	75 e6                	jne    801c25 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801c3f:	b8 00 00 00 00       	mov    $0x0,%eax
  801c44:	eb 0b                	jmp    801c51 <ipc_find_env+0x3b>
			return envs[i].env_id;
  801c46:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801c49:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801c4e:	8b 40 48             	mov    0x48(%eax),%eax
}
  801c51:	5d                   	pop    %ebp
  801c52:	c3                   	ret    

00801c53 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801c53:	f3 0f 1e fb          	endbr32 
  801c57:	55                   	push   %ebp
  801c58:	89 e5                	mov    %esp,%ebp
  801c5a:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801c5d:	89 c2                	mov    %eax,%edx
  801c5f:	c1 ea 16             	shr    $0x16,%edx
  801c62:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801c69:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801c6e:	f6 c1 01             	test   $0x1,%cl
  801c71:	74 1c                	je     801c8f <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801c73:	c1 e8 0c             	shr    $0xc,%eax
  801c76:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801c7d:	a8 01                	test   $0x1,%al
  801c7f:	74 0e                	je     801c8f <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801c81:	c1 e8 0c             	shr    $0xc,%eax
  801c84:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801c8b:	ef 
  801c8c:	0f b7 d2             	movzwl %dx,%edx
}
  801c8f:	89 d0                	mov    %edx,%eax
  801c91:	5d                   	pop    %ebp
  801c92:	c3                   	ret    
  801c93:	66 90                	xchg   %ax,%ax
  801c95:	66 90                	xchg   %ax,%ax
  801c97:	66 90                	xchg   %ax,%ax
  801c99:	66 90                	xchg   %ax,%ax
  801c9b:	66 90                	xchg   %ax,%ax
  801c9d:	66 90                	xchg   %ax,%ax
  801c9f:	90                   	nop

00801ca0 <__udivdi3>:
  801ca0:	f3 0f 1e fb          	endbr32 
  801ca4:	55                   	push   %ebp
  801ca5:	57                   	push   %edi
  801ca6:	56                   	push   %esi
  801ca7:	53                   	push   %ebx
  801ca8:	83 ec 1c             	sub    $0x1c,%esp
  801cab:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801caf:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801cb3:	8b 74 24 34          	mov    0x34(%esp),%esi
  801cb7:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801cbb:	85 d2                	test   %edx,%edx
  801cbd:	75 19                	jne    801cd8 <__udivdi3+0x38>
  801cbf:	39 f3                	cmp    %esi,%ebx
  801cc1:	76 4d                	jbe    801d10 <__udivdi3+0x70>
  801cc3:	31 ff                	xor    %edi,%edi
  801cc5:	89 e8                	mov    %ebp,%eax
  801cc7:	89 f2                	mov    %esi,%edx
  801cc9:	f7 f3                	div    %ebx
  801ccb:	89 fa                	mov    %edi,%edx
  801ccd:	83 c4 1c             	add    $0x1c,%esp
  801cd0:	5b                   	pop    %ebx
  801cd1:	5e                   	pop    %esi
  801cd2:	5f                   	pop    %edi
  801cd3:	5d                   	pop    %ebp
  801cd4:	c3                   	ret    
  801cd5:	8d 76 00             	lea    0x0(%esi),%esi
  801cd8:	39 f2                	cmp    %esi,%edx
  801cda:	76 14                	jbe    801cf0 <__udivdi3+0x50>
  801cdc:	31 ff                	xor    %edi,%edi
  801cde:	31 c0                	xor    %eax,%eax
  801ce0:	89 fa                	mov    %edi,%edx
  801ce2:	83 c4 1c             	add    $0x1c,%esp
  801ce5:	5b                   	pop    %ebx
  801ce6:	5e                   	pop    %esi
  801ce7:	5f                   	pop    %edi
  801ce8:	5d                   	pop    %ebp
  801ce9:	c3                   	ret    
  801cea:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801cf0:	0f bd fa             	bsr    %edx,%edi
  801cf3:	83 f7 1f             	xor    $0x1f,%edi
  801cf6:	75 48                	jne    801d40 <__udivdi3+0xa0>
  801cf8:	39 f2                	cmp    %esi,%edx
  801cfa:	72 06                	jb     801d02 <__udivdi3+0x62>
  801cfc:	31 c0                	xor    %eax,%eax
  801cfe:	39 eb                	cmp    %ebp,%ebx
  801d00:	77 de                	ja     801ce0 <__udivdi3+0x40>
  801d02:	b8 01 00 00 00       	mov    $0x1,%eax
  801d07:	eb d7                	jmp    801ce0 <__udivdi3+0x40>
  801d09:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d10:	89 d9                	mov    %ebx,%ecx
  801d12:	85 db                	test   %ebx,%ebx
  801d14:	75 0b                	jne    801d21 <__udivdi3+0x81>
  801d16:	b8 01 00 00 00       	mov    $0x1,%eax
  801d1b:	31 d2                	xor    %edx,%edx
  801d1d:	f7 f3                	div    %ebx
  801d1f:	89 c1                	mov    %eax,%ecx
  801d21:	31 d2                	xor    %edx,%edx
  801d23:	89 f0                	mov    %esi,%eax
  801d25:	f7 f1                	div    %ecx
  801d27:	89 c6                	mov    %eax,%esi
  801d29:	89 e8                	mov    %ebp,%eax
  801d2b:	89 f7                	mov    %esi,%edi
  801d2d:	f7 f1                	div    %ecx
  801d2f:	89 fa                	mov    %edi,%edx
  801d31:	83 c4 1c             	add    $0x1c,%esp
  801d34:	5b                   	pop    %ebx
  801d35:	5e                   	pop    %esi
  801d36:	5f                   	pop    %edi
  801d37:	5d                   	pop    %ebp
  801d38:	c3                   	ret    
  801d39:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d40:	89 f9                	mov    %edi,%ecx
  801d42:	b8 20 00 00 00       	mov    $0x20,%eax
  801d47:	29 f8                	sub    %edi,%eax
  801d49:	d3 e2                	shl    %cl,%edx
  801d4b:	89 54 24 08          	mov    %edx,0x8(%esp)
  801d4f:	89 c1                	mov    %eax,%ecx
  801d51:	89 da                	mov    %ebx,%edx
  801d53:	d3 ea                	shr    %cl,%edx
  801d55:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801d59:	09 d1                	or     %edx,%ecx
  801d5b:	89 f2                	mov    %esi,%edx
  801d5d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801d61:	89 f9                	mov    %edi,%ecx
  801d63:	d3 e3                	shl    %cl,%ebx
  801d65:	89 c1                	mov    %eax,%ecx
  801d67:	d3 ea                	shr    %cl,%edx
  801d69:	89 f9                	mov    %edi,%ecx
  801d6b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801d6f:	89 eb                	mov    %ebp,%ebx
  801d71:	d3 e6                	shl    %cl,%esi
  801d73:	89 c1                	mov    %eax,%ecx
  801d75:	d3 eb                	shr    %cl,%ebx
  801d77:	09 de                	or     %ebx,%esi
  801d79:	89 f0                	mov    %esi,%eax
  801d7b:	f7 74 24 08          	divl   0x8(%esp)
  801d7f:	89 d6                	mov    %edx,%esi
  801d81:	89 c3                	mov    %eax,%ebx
  801d83:	f7 64 24 0c          	mull   0xc(%esp)
  801d87:	39 d6                	cmp    %edx,%esi
  801d89:	72 15                	jb     801da0 <__udivdi3+0x100>
  801d8b:	89 f9                	mov    %edi,%ecx
  801d8d:	d3 e5                	shl    %cl,%ebp
  801d8f:	39 c5                	cmp    %eax,%ebp
  801d91:	73 04                	jae    801d97 <__udivdi3+0xf7>
  801d93:	39 d6                	cmp    %edx,%esi
  801d95:	74 09                	je     801da0 <__udivdi3+0x100>
  801d97:	89 d8                	mov    %ebx,%eax
  801d99:	31 ff                	xor    %edi,%edi
  801d9b:	e9 40 ff ff ff       	jmp    801ce0 <__udivdi3+0x40>
  801da0:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801da3:	31 ff                	xor    %edi,%edi
  801da5:	e9 36 ff ff ff       	jmp    801ce0 <__udivdi3+0x40>
  801daa:	66 90                	xchg   %ax,%ax
  801dac:	66 90                	xchg   %ax,%ax
  801dae:	66 90                	xchg   %ax,%ax

00801db0 <__umoddi3>:
  801db0:	f3 0f 1e fb          	endbr32 
  801db4:	55                   	push   %ebp
  801db5:	57                   	push   %edi
  801db6:	56                   	push   %esi
  801db7:	53                   	push   %ebx
  801db8:	83 ec 1c             	sub    $0x1c,%esp
  801dbb:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801dbf:	8b 74 24 30          	mov    0x30(%esp),%esi
  801dc3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801dc7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801dcb:	85 c0                	test   %eax,%eax
  801dcd:	75 19                	jne    801de8 <__umoddi3+0x38>
  801dcf:	39 df                	cmp    %ebx,%edi
  801dd1:	76 5d                	jbe    801e30 <__umoddi3+0x80>
  801dd3:	89 f0                	mov    %esi,%eax
  801dd5:	89 da                	mov    %ebx,%edx
  801dd7:	f7 f7                	div    %edi
  801dd9:	89 d0                	mov    %edx,%eax
  801ddb:	31 d2                	xor    %edx,%edx
  801ddd:	83 c4 1c             	add    $0x1c,%esp
  801de0:	5b                   	pop    %ebx
  801de1:	5e                   	pop    %esi
  801de2:	5f                   	pop    %edi
  801de3:	5d                   	pop    %ebp
  801de4:	c3                   	ret    
  801de5:	8d 76 00             	lea    0x0(%esi),%esi
  801de8:	89 f2                	mov    %esi,%edx
  801dea:	39 d8                	cmp    %ebx,%eax
  801dec:	76 12                	jbe    801e00 <__umoddi3+0x50>
  801dee:	89 f0                	mov    %esi,%eax
  801df0:	89 da                	mov    %ebx,%edx
  801df2:	83 c4 1c             	add    $0x1c,%esp
  801df5:	5b                   	pop    %ebx
  801df6:	5e                   	pop    %esi
  801df7:	5f                   	pop    %edi
  801df8:	5d                   	pop    %ebp
  801df9:	c3                   	ret    
  801dfa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801e00:	0f bd e8             	bsr    %eax,%ebp
  801e03:	83 f5 1f             	xor    $0x1f,%ebp
  801e06:	75 50                	jne    801e58 <__umoddi3+0xa8>
  801e08:	39 d8                	cmp    %ebx,%eax
  801e0a:	0f 82 e0 00 00 00    	jb     801ef0 <__umoddi3+0x140>
  801e10:	89 d9                	mov    %ebx,%ecx
  801e12:	39 f7                	cmp    %esi,%edi
  801e14:	0f 86 d6 00 00 00    	jbe    801ef0 <__umoddi3+0x140>
  801e1a:	89 d0                	mov    %edx,%eax
  801e1c:	89 ca                	mov    %ecx,%edx
  801e1e:	83 c4 1c             	add    $0x1c,%esp
  801e21:	5b                   	pop    %ebx
  801e22:	5e                   	pop    %esi
  801e23:	5f                   	pop    %edi
  801e24:	5d                   	pop    %ebp
  801e25:	c3                   	ret    
  801e26:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e2d:	8d 76 00             	lea    0x0(%esi),%esi
  801e30:	89 fd                	mov    %edi,%ebp
  801e32:	85 ff                	test   %edi,%edi
  801e34:	75 0b                	jne    801e41 <__umoddi3+0x91>
  801e36:	b8 01 00 00 00       	mov    $0x1,%eax
  801e3b:	31 d2                	xor    %edx,%edx
  801e3d:	f7 f7                	div    %edi
  801e3f:	89 c5                	mov    %eax,%ebp
  801e41:	89 d8                	mov    %ebx,%eax
  801e43:	31 d2                	xor    %edx,%edx
  801e45:	f7 f5                	div    %ebp
  801e47:	89 f0                	mov    %esi,%eax
  801e49:	f7 f5                	div    %ebp
  801e4b:	89 d0                	mov    %edx,%eax
  801e4d:	31 d2                	xor    %edx,%edx
  801e4f:	eb 8c                	jmp    801ddd <__umoddi3+0x2d>
  801e51:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e58:	89 e9                	mov    %ebp,%ecx
  801e5a:	ba 20 00 00 00       	mov    $0x20,%edx
  801e5f:	29 ea                	sub    %ebp,%edx
  801e61:	d3 e0                	shl    %cl,%eax
  801e63:	89 44 24 08          	mov    %eax,0x8(%esp)
  801e67:	89 d1                	mov    %edx,%ecx
  801e69:	89 f8                	mov    %edi,%eax
  801e6b:	d3 e8                	shr    %cl,%eax
  801e6d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801e71:	89 54 24 04          	mov    %edx,0x4(%esp)
  801e75:	8b 54 24 04          	mov    0x4(%esp),%edx
  801e79:	09 c1                	or     %eax,%ecx
  801e7b:	89 d8                	mov    %ebx,%eax
  801e7d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801e81:	89 e9                	mov    %ebp,%ecx
  801e83:	d3 e7                	shl    %cl,%edi
  801e85:	89 d1                	mov    %edx,%ecx
  801e87:	d3 e8                	shr    %cl,%eax
  801e89:	89 e9                	mov    %ebp,%ecx
  801e8b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801e8f:	d3 e3                	shl    %cl,%ebx
  801e91:	89 c7                	mov    %eax,%edi
  801e93:	89 d1                	mov    %edx,%ecx
  801e95:	89 f0                	mov    %esi,%eax
  801e97:	d3 e8                	shr    %cl,%eax
  801e99:	89 e9                	mov    %ebp,%ecx
  801e9b:	89 fa                	mov    %edi,%edx
  801e9d:	d3 e6                	shl    %cl,%esi
  801e9f:	09 d8                	or     %ebx,%eax
  801ea1:	f7 74 24 08          	divl   0x8(%esp)
  801ea5:	89 d1                	mov    %edx,%ecx
  801ea7:	89 f3                	mov    %esi,%ebx
  801ea9:	f7 64 24 0c          	mull   0xc(%esp)
  801ead:	89 c6                	mov    %eax,%esi
  801eaf:	89 d7                	mov    %edx,%edi
  801eb1:	39 d1                	cmp    %edx,%ecx
  801eb3:	72 06                	jb     801ebb <__umoddi3+0x10b>
  801eb5:	75 10                	jne    801ec7 <__umoddi3+0x117>
  801eb7:	39 c3                	cmp    %eax,%ebx
  801eb9:	73 0c                	jae    801ec7 <__umoddi3+0x117>
  801ebb:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801ebf:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801ec3:	89 d7                	mov    %edx,%edi
  801ec5:	89 c6                	mov    %eax,%esi
  801ec7:	89 ca                	mov    %ecx,%edx
  801ec9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801ece:	29 f3                	sub    %esi,%ebx
  801ed0:	19 fa                	sbb    %edi,%edx
  801ed2:	89 d0                	mov    %edx,%eax
  801ed4:	d3 e0                	shl    %cl,%eax
  801ed6:	89 e9                	mov    %ebp,%ecx
  801ed8:	d3 eb                	shr    %cl,%ebx
  801eda:	d3 ea                	shr    %cl,%edx
  801edc:	09 d8                	or     %ebx,%eax
  801ede:	83 c4 1c             	add    $0x1c,%esp
  801ee1:	5b                   	pop    %ebx
  801ee2:	5e                   	pop    %esi
  801ee3:	5f                   	pop    %edi
  801ee4:	5d                   	pop    %ebp
  801ee5:	c3                   	ret    
  801ee6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801eed:	8d 76 00             	lea    0x0(%esi),%esi
  801ef0:	29 fe                	sub    %edi,%esi
  801ef2:	19 c3                	sbb    %eax,%ebx
  801ef4:	89 f2                	mov    %esi,%edx
  801ef6:	89 d9                	mov    %ebx,%ecx
  801ef8:	e9 1d ff ff ff       	jmp    801e1a <__umoddi3+0x6a>
